]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dmaengine: st_fdma: fix uninitialized variable access
authorArnd Bergmann <arnd@arndb.de>
Wed, 19 Oct 2016 12:09:10 +0000 (14:09 +0200)
committerVinod Koul <vinod.koul@intel.com>
Wed, 19 Oct 2016 13:14:42 +0000 (18:44 +0530)
commit919b742fb5f4c14a5b171430cd8bdbef75926ad5
treeb3f23e81fd354e73ca48285386a4a3f316f4f5bc
parentecaf33bc037a89c10491d5fadb86aeb1bddfa826
dmaengine: st_fdma: fix uninitialized variable access

The newly added st_fdma driver introduces a build warning for
allmodconfig when we add '-Wmaybe-uninitialized':

drivers/dma/st_fdma.c: In function 'st_fdma_probe':
drivers/dma/st_fdma.c:777:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The warning is correct, though this can't happen in practice
as the check is redundant (we don't get to this function if
the pointer is NULL). Even if the function were called with a
NULL of_node, the check is not needed because of_property_read_u32
can deal with a NULL argument by returning an error.

Removing the unnecessary code simplifies the function and avoids
the condition that we get the warning for.

Fixes: 6b4cd727eaf1 ("dmaengine: st_fdma: Add STMicroelectronics FDMA engine driver support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/st_fdma.c