Skip to content

Commit 620a7e4

Browse files
nathanchancevinodkoul
authored andcommitted
dmaengine: xilinx: xdma: Fix initialization location of desc in xdma_channel_isr()
Clang warns (or errors with CONFIG_WERROR=y): drivers/dma/xilinx/xdma.c:894:3: error: variable 'desc' is uninitialized when used here [-Werror,-Wuninitialized] 894 | desc->error = true; | ^~~~ The initialization of desc was moved too far forward, move it back so that this assignment does not result in a potential crash at runtime while clearing up the warning. Closes: ClangBuiltLinux#1972 Fixes: 2f8f90c ("dmaengine: xilinx: xdma: Implement interleaved DMA transfers") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20231222-dma-xilinx-xdma-clang-fixes-v1-2-84a18ff184d2@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent fe0d495 commit 620a7e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/dma/xilinx/xdma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,8 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id)
888888
if (ret)
889889
goto out;
890890

891+
desc = to_xdma_desc(vd);
892+
891893
st &= XDMA_CHAN_STATUS_MASK;
892894
if ((st & XDMA_CHAN_ERROR_MASK) ||
893895
!(st & (CHAN_CTRL_IE_DESC_COMPLETED | CHAN_CTRL_IE_DESC_STOPPED))) {
@@ -901,7 +903,6 @@ static irqreturn_t xdma_channel_isr(int irq, void *dev_id)
901903
if (ret)
902904
goto out;
903905

904-
desc = to_xdma_desc(vd);
905906
if (desc->interleaved_dma) {
906907
xchan->busy = false;
907908
desc->completed_desc_num += complete_desc_num;

0 commit comments

Comments
 (0)