msm: vidc: fix memory leak issue in dynamic buffer mode

While flushing output buffers held in v4l2 video
driver, i.e, with ref count equal to 2, the driver
was freeing the binfo structure. This would leak
the mapped output buffer memory. By avoiding
freeing of the binfo structure, the driver waits
for the release reference event from the firmware
to free and unmap the output buffer. Also move
initialization of dequeued flag for buffers to be
held in driver, till the time we queue this buffer
to firmware. By not doing so, the video driver can
enter a race condition, whereby, a output buffer could
be unmapped and freed before v4l2 client has called
dequeue on the buffer.

Change-Id: Ic95f13b9f4426574012539a76c0b87bedb8e805a
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
ext4: fix memory leak in xattr

If we take the 2nd retry path in ext4_expand_extra_isize_ea, we
potentionally return from the function without having freed these
allocations.  If we don't do the return, we over-write the previous
allocation pointers, so we leak either way.

Spotted with Coverity.

[ Fixed by tytso to set is and bs to NULL after freeing these
  pointers, in case in the retry loop we later end up triggering an
  error causing a jump to cleanup, at which point we could have a double
  free bug. -- Ted ]

Change-Id: I49b8ca41a6c6d44b563eb23306870258a3affd3b
Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Cc: stable@vger.kernel.org
Git-commit: 6e4ea8e33b2057b85d75175dd89b93f5e26de3bc
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
mdss: dsi: Resolving memory leak in parse dsi commands

Free buf variable before exiting function in error cases
in order to avoid possible memory leaks.

Change-Id: I8ebc3f0f3f40be85e312f9646374a074f1414bdb
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
lge_touch_core: Don't announce support for ALL the tools

This confuses the heck out of some apps, and it's simply not true

Change-Id: I68742a8213ca541c017fbdf839194cd34eaea2d6
arm/dt: msm8226: Add adsp heap

Add adsp ION heap for 8226

Change-Id: If5d4cefb696ed811574b9d942d080b8d66687a46
Signed-off-by: Krupal Divvela <kdivvela@codeaurora.org>
gpu: ion: Add support for specifying heap type in the device tree

Currently, there is no way to swap out the underlying heap type for a
given heap ID without modifying msm_ion.c and recompiling the
kernel. This is inconsistent with the rest of Ion which is customized
through the device tree. This change eliminates the need to modify and
recompile the kernel for heap type changes (although the boot image
will still need to be regenerated).

Add a device tree binding to specify the heap_type for Ion heaps.

Change-Id: I0a2b48299c829a828764d74a1d8e3c8f97de706d
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
galbi: Declare ION carveouts in DT files

Required after I0a2b48299c829a828764d74a1d8e3c8f97de706d

Change-Id: I7122029aa3842fc90b88b48cb568599fe125f5b8
gpu: ion: remove IOMMU Heap

The IOMMU heap has been merged into the System heap since there was so
much overlap between the two. Remove the IOMMU heap. ION_IOMMU_HEAP_ID
will now alias to ION_SYSTEM_HEAP_ID.

Change-Id: I1cea1d97eba1488f8d5928e6a0f31a18b0fd92e5
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
leds: pm8xxx: Enable PWM LPG banks based on max current

The current design enables PWM LPG high bank with out
checking the max current. So enable PWM LPG low bank when max
current configured as 4mA and enable PWM LPG high bank when
the max current configured as 8mA. Enabled both PWM LPG low bank
and PWM LPG high bank when max current configure as 12mA.

CRs-Fixed: 486318
Change-Id: Ib7177aafc63c4c33b8c144d665a11d5aaf0ef584
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
mfd: pm8xxx-pwm: Set default to enable both PWM banks

In the cases where PWM lut_config is not required, both PWM banks
are not enabled. So set default to enable both PWM banks if neither
is selected or PWM enable is called without PWM lut_config.

Change-Id: I2bbed2f055022689c5943e374ac99fce4387f663
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
mfd: pm8xxx-pwm: Add support for pwm size of 7 bit

The existing pwm driver only supports 6 and 9bit pwm modes.
In 6 bit and 9 bit PWM modes, PWM high bank supports 12mA current
sink and 4mA current sink is not supported with PWM low bank in
these PWM podes. To support 4mA PWM current sink enable 7 bit PWM
mode and PWM low bank.

CRs-Fixed: 486318
Change-Id: I639d516196bda47346c979f5b8ae3c27fcaef104
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
msm_serial_hs: Add runtime support for determining UARTDM register offsets

Currently, HSUART uses a Kconfig option to determine the UARTDM core
version register offsets during compile time. This change adds runtime
configuration support for determining the version of the UARTDM core,
and use the same with appropriate register mappings in HSUART driver.

Also with addition of runtime support for determining the UARTDM core
version register offsets, Kconfig CONFIG_MSM_UARTDM_Core_v14 is no longer
required. This change also does clean up of defconfig files for removing
the config and uart register header files for achieving the same.

CRs-Fixed: 459281
Change-Id: Iff4ad1c37a3b04345d68cbe0a8befa284b49a539
Signed-off-by: Saket Saurabh <ssaurabh@codeaurora.org>
msm_serial_hs: Fix race condition with BAM rx pipe

Crash observed due to the race condition with bam
rx pipe during sps_disconnect and sps_transfer_one
operations executed at the same time on two CPUs.

Because of this race condition rx bam descriptor
pointer becomes NULL and accessing of this pointer
leads to crash.

This patch waits for sps_transfer_one function to
complete, if it is in progress, before calling
sps_disconnect function from the set_termios.

CRs-Fixed: 534029
Change-Id: I7581062a17a3dc7ede8eb58e4d25e3b517812ab2
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>