Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wuninitialized in drivers/dma/xilinx/xdma.c #1972

Closed
nathanchance opened this issue Dec 22, 2023 · 1 comment
Closed

-Wuninitialized in drivers/dma/xilinx/xdma.c #1972

nathanchance opened this issue Dec 22, 2023 · 1 comment
Assignees
Labels
-Wuninitialized [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle

Comments

@nathanchance
Copy link
Member

drivers/dma/xilinx/xdma.c:894:3: error: variable 'desc' is uninitialized when used here [-Werror,-Wuninitialized]
  894 |                 desc->error = true;
      |                 ^~~~
drivers/dma/xilinx/xdma.c:874:24: note: initialize the variable 'desc' to silence this warning
  874 |         struct xdma_desc *desc;
      |                               ^
      |                                = NULL
1 error generated.

Patch submitted: https://lore.kernel.org/all/20231222-dma-xilinx-xdma-clang-fixes-v1-2-84a18ff184d2@kernel.org/

@nathanchance nathanchance added [PATCH] Submitted A patch has been submitted for review -Wuninitialized [BUG] linux-next This is an issue only seen in linux-next labels Dec 22, 2023
@nathanchance nathanchance self-assigned this Dec 22, 2023
torvalds pushed a commit to torvalds/linux that referenced this issue Jan 20, 2024
…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>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle and removed [PATCH] Submitted A patch has been submitted for review labels Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Wuninitialized [BUG] linux-next This is an issue only seen in linux-next [FIXED][LINUX] development cycle This bug was only present and fixed in a -next or -rc cycle
Projects
None yet
Development

No branches or pull requests

1 participant