mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
28f7aa0c01
Fix an issue detected by the Smatch tool: sound/soc/bcm/bcm63xx-pcm-whistler.c:264 i2s_dma_isr() error: uninitialized symbol 'val_1'. sound/soc/bcm/bcm63xx-pcm-whistler.c:264 i2s_dma_isr() error: uninitialized symbol 'val_2'. These errors were triggered because the variables 'val_1' and 'val_2' could remain uninitialized if 'offlevel' is zero, meaning the loop that assigns values to them does not execute. In this case, 'dma_addr_next' would use uninitialized data, potentially leading to undefined behavior. To resolve this, a conditional update for 'dma_addr_next' is added, ensuring it is assigned only when 'val_1' and 'val_2' are read. A new boolean variable 'val_read' flags when the values have been retrieved, setting 'dma_addr_next' only if valid data is available. This solution prevents the use of uninitialized data, maintaining defined behavior for 'dma_addr_next' in all cases, and aligns with expected usage of I2S RX descriptor data. Signed-off-by: Suraj Sonawane <surajsonawane0215@gmail.com> Link: https://patch.msgid.link/20241102123630.25446-1-surajsonawane0215@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> |
||
---|---|---|
.. | ||
bcm63xx-i2s-whistler.c | ||
bcm63xx-i2s.h | ||
bcm63xx-pcm-whistler.c | ||
bcm2835-i2s.c | ||
cygnus-pcm.c | ||
cygnus-ssp.c | ||
cygnus-ssp.h | ||
Kconfig | ||
Makefile |