Files
kernel_arpi/include/linux
Lukas Wunner 53a256a9b9 dmaengine: Fix access to uninitialized dma_slave_caps
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: 272420214d ("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>
2019-12-11 16:03:20 +05:30
..
2019-11-12 11:43:29 -05:00
2019-10-31 16:54:00 +05:30
2019-11-15 23:44:48 +01:00
2019-12-03 07:36:38 -07:00
2019-11-26 10:26:26 +01:00
2019-12-03 11:20:37 +01:00
2019-11-20 09:40:10 +01:00
2019-12-01 12:59:06 -08:00
2019-11-11 09:02:56 +01:00
2019-12-04 19:44:14 -08:00
2019-11-15 13:49:04 -05:00
2019-11-14 19:06:47 -08:00
2019-11-06 08:55:23 -05:00
2019-11-06 08:55:23 -05:00
2019-11-13 19:09:47 +08:00
2019-11-14 13:07:48 +08:00
2019-12-04 19:44:14 -08:00
2019-12-01 06:29:17 -08:00
2019-11-13 12:15:34 -08:00
2019-11-13 00:33:21 +11:00
2019-11-07 07:00:26 +01:00
2019-11-14 12:20:02 +08:00