android_kernel_samsung_a7y1.../include
Lukas Wunner e1ded4bb11 dmaengine: Fix access to uninitialized dma_slave_caps
commit 53a256a9b925b47c7e67fc1f16ca41561a7b877c upstream.

dmaengine_desc_set_reuse() allocates a struct dma_slave_caps on the
stack, populates it using dma_get_slave_caps() and then accesses one
of its members.

However dma_get_slave_caps() may fail and this isn't accounted for,
leading to a legitimate warning of gcc-4.9 (but not newer versions):

   In file included from drivers/spi/spi-bcm2835.c:19:0:
   drivers/spi/spi-bcm2835.c: In function 'dmaengine_desc_set_reuse':
>> include/linux/dmaengine.h:1370:10: warning: 'caps.descriptor_reuse' is used uninitialized in this function [-Wuninitialized]
     if (caps.descriptor_reuse) {

Fix it, thereby also silencing the gcc-4.9 warning.

The issue has been present for 4 years but surfaces only now that
the first caller of dmaengine_desc_set_reuse() has been added in
spi-bcm2835.c. Another user of reusable DMA descriptors has existed
for a while in pxa_camera.c, but it sets the DMA_CTRL_REUSE flag
directly instead of calling dmaengine_desc_set_reuse(). Nevertheless,
tag this commit for stable in case there are out-of-tree users.

Fixes: 272420214d26 ("dmaengine: Add DMA_CTRL_REUSE")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org # v4.3+
Link: https://lore.kernel.org/r/ca92998ccc054b4f2bfd60ef3adbab2913171eac.1575546234.git.lukas@wunner.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 13:24:41 +02:00
..
acpi A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
asm-generic asm-generic: default BUG_ON(x) to if(x)BUG() 2020-04-06 20:50:09 +02:00
clocksource A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
drm drm: mst: Fix query_payload ack reply struct 2020-04-07 13:20:02 +02:00
dt-bindings A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
keys A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
kvm A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
linux dmaengine: Fix access to uninitialized dma_slave_caps 2020-04-07 13:24:41 +02:00
math-emu math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning 2020-04-07 12:44:41 +02:00
media A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
memory A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
misc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
net net: dst: Force 4-byte alignment of dst_metrics 2020-04-07 13:22:22 +02:00
pcmcia A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ras A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rdma A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rxrpc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scsc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scsi scsi: target: iscsi: Wait for all commands to finish before freeing a session 2020-04-07 13:23:29 +02:00
sdp A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
soc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sound ASoC: Define a set of DAPM pre/post-up events 2020-04-07 08:07:42 +02:00
target A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
trace A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uapi isdn/capi: check message length in capi_write() 2020-04-06 21:35:15 +02:00
video fbdev: Remove unused SH-Mobile HDMI driver 2020-04-07 12:31:27 +02:00
xen A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kbuild A750FXXU4CTBC 2020-03-27 21:51:54 +05:30