msm: kgsl: Remove sscanf() from kgsl_pwrctrl.c

Replace sscanf() in kgsl_pwrctrl.c with a generic function to safely
convert 32 bit unsigned ints.

CRs-fixed: 563585
Change-Id: Ic0dedbad10e2264ec8fccab622d094d123b49b77
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: qdsp6v2: Increase max ports in APR

Increase the maximum ports in APR. Some Apps may support
multiple clients which exceeds the number of clients
supported in APR. This change increases number of ports
used in APR upto 8 sessions.

Change-Id: I06624330845681b4414dd470ab7aed669d690ba0
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
msm: vidc: add input parameter checks to exported functions

Check for invalid null parameter passed to functions

CRs-Fixed: 606467
Change-Id: I860ca3d69d8705c7b3d6f27f9504b567be5aeea3
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
ion: invalidate buffers before zero'ing

Currently, we invalidate the cache for buffers being zero'd *after* we
zero them. However, this is racey since a dirty cache line from an
earlier mapping could be written out to memory between the zero'ing and
the invalidation. Fix this by invalidating the cache *before* zero'ing
the buffer.

Before this change, I was seeing corruption with:

    $ cat <<EOF | ./memory_prof -e -i -
    simple_alloc,1,ION_SYSTEM_HEAP_ID,ION_FLAG_CACHED,0x100000,1MB
    simple_basic_sanity,1
    simple_profile,1
    simple_free,1
    EOF

After this change, no corruption.

CRs-Fixed: 585524
Change-Id: I1f2603604efc9be4ebf9112b06728e0aeca60ea0
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Merge "msm: vidc: add input parameter checks to exported functions"
Merge "msm: qdsp6v2: Increase max ports in APR"
msm: kgsl: don't use sscanf()

Friends do not let friends use sscanf().

CRs-Fixed: 563605
Change-Id: Ic0dedbad56af5bbee4fc833701d8bc93b118efa9
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: vidc: Add null pointer checks

msm_vidc_inst pointer instance is used in without any null
pointer check, dereferencing t could device crash.
Fix the issue by adding null pointer checks.

Change-Id: Ia17b380063326aa587aac941aac0131871147e8a
CRs-Fixed: 606486,606469
Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
msm: vidc: add input check for hfi q6 function

The input parameters may be null. This change adds input checks at
function q6_hfi_iface_eventq_read.

CRs-Fixed: 606516
Change-Id: I801a9d3249e9b97fa218fc29bc3a2a0e7a0d4d3f
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: add kzalloc success check for new q6 HAL session

Memory allocation must be verified before proceeding.

CRs-Fixed: 606522
Change-Id: I809acc21dcd5e680827feb5d0fa8f45814bf4773
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
msm: vidc: add kzalloc success check for new HAL session

Memory allocation must be verified before proceeding.

CRs-Fixed: 606527
Change-Id: Ic340bf9926f84507294c576997948ddbe61dd62f
Signed-off-by: Jorge Solano Altamirano <jsolano@codeaurora.org>
ASoC: msm: qdsp6v2: fix possible integer overflow

Check integer overflow before multiplying struct size. If that happens
should return immediately. In addition if param length is greater than
MAX size from spec, better return error.

Change-Id: Ifa2875f0dfa57e9bad1721aa96b5a50d24eb2030
CRs-fixed: 605273
Signed-off-by: Fred Oh <fred@codeaurora.org>
Revert "mdss: mdp3: enhance vsync event report for mdp3"

This reverts commit 5e4ac304128c448dfefe4404c320f890481b5001

Change-Id: Ie1c8ea2542093566ed32ae0051bf9ca591bc2899
Merge "msm: vidc: Add null pointer checks"
Merge "msm: vidc: add input check for hfi q6 function"
Merge "msm: vidc: add kzalloc success check for new q6 HAL session"
Merge "ASoC: msm: qdsp6v2: fix possible integer overflow"
Merge "msm: vidc: add kzalloc success check for new HAL session"
qseecom: Validate pointer offset in qseecom_send_modfd_cmd

Validate cmd_req_buf pointer offset in qseecom_send_modfy_cmd, and
make sure cmd buffer address to be within shared bufffer.

Change-Id: I431511a92ab2cccbc2daebc0cf76cc3872689a97
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
lib/scatterlist: error handling in __sg_alloc_table()

I was reviewing code which I suspected might allocate a zero size SG
table.  That will cause memory corruption.  Also we can't return before
doing the memset or we could end up using uninitialized memory in the
cleanup path.

Change-Id: Icee6be8ea22644d7f16264d9d2a0887c7145996b
CRs-Fixed: 611562
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>