msm: mdss: Check null-pointer dereferencing and buffer overflows

Add checks before possible null-pointer dereferencing. Add checks to
prevent buffer out-of-bounds access.

Change-Id: I17419c82654c4ad2d18c7f88e34447cf333450bb
Signed-off-by: Mathew Karimpanal <kjmathew@codeaurora.org>
Signed-off-by: Beeresh Gopal <gbeeresh@codeaurora.org>
msm: mdss: release secure UI buffer as soon as pipe is destroyed

When secure UI session is in progress, need to make sure that the
buffers are released as soon as pipe is freed to make sure secure
session can be properly terminated without any secure UI buffers
remaining as mapped.

CRs-Fixed: 619802
Change-Id: Ia2fa87f3182efc170304a53eb8d6b3f614355245
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
power: qpnp-bms: add a delay for timing requirement

A delay of 2 sleep clock cycles (~60 microseconds) is found to be needed
between locking the bms output registers and reading the coulomb counter.
Without this delay, there can be a potential SPMI transaction failure
where the peripheral fails to respond.

As a safety measure, also add error handling code to abort the current SOC
calculation if a read fails.

CRs-Fixed: 720880
Change-Id: Ia632e31202791afa82ff4b49a8eaa334fd22da8f
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
platform: msm: fix s3 source macros

PON stage 3 source macros are wrongly ordered. Fix the
S3 source macros with proper values.

Change-Id: If68d7405d9db107a4d2aceb152589da2e34fc73b
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
platform: qpnp-power-on: choose correct s2 control registers

The PMICs which have PON_REVISION2 register value as 0x00
have a single register for both s2 reset type and
s2 reset enable. All the other PON revisions have separate
registers for s2 reset type and s2 reset enable. Add support
to choose correct s2 control registers based on PON_REVISION2
register value.

Change-Id: Iaf0fb5c10a6883092d6a49336c40df0db7940ad2
CRs-Fixed: 661934
Signed-off-by: Abinaya P <abinayap@codeaurora.org>
msm_serial_hs: Handle client requests without port open

Adding defensive checks in the APIs to handle the
client driver requests calling without port open.

Change-Id: I0d618abbc7a38151651550a07aa909689ce92054
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
msm: vidc: Enable clocks before iommu attach

Change the fw load sequence to match the opposite of
unload sequence. This makes sure all clocks are on before calling
iommu attach.

Change-Id: I1113357c37158da5889f26da8fd4a74d0d170c07
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
kernel: cgroup: protect cgroup linked lists

Protecting cgroup lists to fix corruption due to race since
freeing of css_set now in new worker thread, free_css_set_work()

CRs-fixed: 715355
Change-Id: Iec4d7be0c372a17487f96bcdc1542afaff79dd1b
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>