msm: qdsp6v2: memset stack buffer allocation.

This is needed to avoid garbage data in uninitialized variables.

Change-Id: Id5921e369055d846b990380be6355ad464518a10
CRs-Fixed: 554301
Signed-off-by: Yeleswarapu, Nagaradhesh <nagaradh@codeaurora.org>
slim_ngd: Add NULL pointer check apart from error check

Check against NULL pointer after allocating
the memory for msm_slim_ctrl structure pointer
dynamically to avoid unexpected crashes.

Earlier this pointer is checked only for error
codes. In this patch NULL pointer check is also
added.

CRs-Fixed: 562417
Change-Id: I5cd731144f88b89ee412d19f110b3df6426186f7
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
msm: cpuidle: use format string in snprintf

Currently no format string specified in snprintf
and this leds to security vulnerability. Use format
string in snprintf function.

CRs-fixed: 562232
Change-Id: Id67efe6952071bda8119ae2be907ea0b15da2797
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
gpu: ion: Use list_for_each_safe on error path

On an error, the list of pages is walked and destroyed. Since the list
is being destroyed, use list_for_each_safe to avoid list corruption.

Change-Id: Ia397a11d2d890b3458745820c79df2adaa088ade
CRs-Fixed: 565183
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: platform: qpnp-clkdiv: fix potential null pointer dereference

Add a return statement in the spmi resource null check in
qpnp_clkdiv_probe().  This is needed in order to avoid
dereferencing a null pointer in a subsequent statement.

Change-Id: Iaf5d5797016c96a136e93c8e5837f7f8f31d1e47
CRs-Fixed: 563655
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: camera: Fix possible NULL pointer dereference.

The result of memory allocation in msm_isp_get_buf is not checked for
success before use. This can lead to NULL pointer dereference.

Change-Id: I83cb56bbcd5e7526bf57a6de1077a30f9a2b5349
Signed-off-by: Petar Sivenov <psiven@codeaurora.org>
mdss: Fix null point dereference in mdss_mdp_pp_init

Fixed null point dereference in case of memory allocation
failure in mdss_mdp_pp_init.

Change-Id: I3593a583da355915b731ac30b1f38aaa010eba85
Signed-off-by: Krishna Chaitanya Parimi<cparimi@codeaurora.org>
ASoC: msm: DTS parameter validation

Validate the modelIdLength before proceeding and copying
the user data.

Change-Id: I659d83376cc893340851d6889019a82d169b2134
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
msm: qdsp6v2: NULL pointer check on userspace data argument in kernel

The null pointer check is required to ensure that userspace data
in kernalspace is not null.

Change-Id: I9e522c393ae643626a4bae03731a73f5d6db6458
CRs-Fixed: 563752
Signed-off-by: Mohammad Johny Shaik <mjshai@codeaurora.org>
msm: mdss: Add NULL pointer checks in mdss_mdp_wb_set_secure

Null pointer dereference can cause kernel panic, hence add
checks to avoid them.

CRs-Fixed: 553552
Change-Id: Ia854d7b65a5cf6a0fa214c34e658ea0f1380ac2c
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: Add error handling in mdss_fb_no_update_notify_timer_cb

Return in case mfd is NULL to avoid NULL pointer dereference.

CRs-Fixed: 563125
Change-Id: I82415ed5f1f7b3d27796e9e3a0c96178aa54bdc5
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: rpm-regulator-smd: correct use-after-free in rpm_vreg_device_remove

Modify the rpm_vreg_device_remove() function so that the reg
pointer is not dereferenced after being freed.

Change-Id: I0bc2c38a00c5d6b783f52c0ae0f1faa31d3a1e4d
CRs-Fixed: 564463
Signed-off-by: David Collins <collinsd@codeaurora.org>
msm: kgsl: Fix mem leak when page allocation fails

Page allocation may fail during OOM condition. Update
sglen and size to correct value (allocated) so that
they get freed in kgsl_sharedmem_free().

Change-Id: I1aa0ca77bb767523dfcf0f6cc3a21eac2b6b80e4
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
radio: iris: Avoid memory leak and NULL pointer dereferencing

 - Avoid memory leak by freeing allocated memory
 - Do not derefer NULL pointer

CRs-Fixed: 537955
Signed-off-by: Ayaz Ahmad <aahmad@codeaurora.org>
Change-Id: I7624d73e5c25233e9d03c67e4204c611b9a8fff6
radio: iris: Avoid inconsistent free

There is a chance to of memory leak if we exit
from function early. Ensure to use free before
exiting from function.

Change-Id: I17dbecffc5713d95c66ecec0bffb5ed3c8660fe8
CRs-Fixed: 540334
Signed-off-by: Ayaz Ahmad <aahmad@codeaurora.org>
msm: camera_v2: cci: check for NULL pointer

in function "msm_cci_subdev_g_chip_ident"
check for NULL pointer and return error
instead of assert

Change-Id: Ia27751c4d6f3d5ead1749e396ffa5c2773f1582b
Signed-off-by: Georgi Hristov <ghristov@codeaurora.org>
msm: reap unused audio files

Removing this file as it is not used in this branch.

Change-Id: Ibff0dbeca0cdae5447d3fd8857ffad296edfdd55
Signed-off-by: anish kumar <kanish@codeaurora.org>
msm: ultrasound: add verifications of some input parameters

Some security vulnerabilities were found.
To fix them, additional verifications of some input parameters
are required.

CRs-Fixed: 554575, 554560, 555030
Change-Id: Ie87a433bcda89c3e462cfd511c168e8306056020
Signed-off-by: Baruch Eruchimovitch <baruche@codeaurora.org>
radio: iris: Avoid NULL pointer dereferencing

Before dereferencing a pointer check for NULL
pointer.

CRs-Fixed: 537890
Signed-off-by: Ayaz Ahmad <aahmad@codeaurora.org>
Change-Id: If010b89fd4f5930d944c9e327c51de4b40f33c3c
msm: buspm: Correct size type in buspm_xfer_req

Variable size inside buspm_xfer_req
can be negative and thus would be a
large positive number resulting in arbitary
Kernel read. This patch corrects this value.

CRs-Fixed: 563529
Change-Id: I877db6960530d6c7d1486da9cfdc15a43e57e152
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>