summaryrefslogtreecommitdiff
path: root/drivers/dma/ptdma/ptdma-dmaengine.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2023-01-28 01:36:27 +0300
committerVinod Koul <vkoul@kernel.org>2023-02-16 16:15:48 +0300
commitbe4d46edeee4b2459d2f53f37ada88bbfb634b6c (patch)
tree234841956deb5baf9a4f0250e12a439d680eb665 /drivers/dma/ptdma/ptdma-dmaengine.c
parent601bdadadb505a72d9a76cc20cdfa252cba7ddc0 (diff)
downloadlinux-be4d46edeee4b2459d2f53f37ada88bbfb634b6c.tar.xz
dmaengine: dw-axi-dmac: Do not dereference NULL structure
If "vdesc" is NULL, it cannot be used with vd_to_axi_desc(). Leave "bytes" unchanged at 0. Seen under GCC 13 with -Warray-bounds: ../drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c: In function 'dma_chan_tx_status': ../drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c:329:46: warning: array subscript 0 is outside array bounds of 'struct virt_dma_desc[46116860184273879]' [-Warray-bounds=] 329 | bytes = vd_to_axi_desc(vdesc)->length; | ^~ Fixes: 8e55444da65c ("dmaengine: dw-axi-dmac: Support burst residue granularity") Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Cc: Vinod Koul <vkoul@kernel.org> Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230127223623.never.507-kees@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/ptdma/ptdma-dmaengine.c')
0 files changed, 0 insertions, 0 deletions