[PATCH] ASoC: tas2781: Initialize subblk_offset in tasdevice_process_block()

From: Ian Rogers

Date: Thu Nov 19 2026 - 12:15:38 EST


When tasdevice_load_block_kernel() processes a per-channel firmware
block (dev_idx != 0) for an amplifier channel whose is_loading flag is
false, tasdevice_process_block() skips the channel via continue and
returns an uninitialized stack variable subblk_offset, which the
caller checks for negative error and adds to the firmware buffer
offset.

Initialize subblk_offset to 0.

Found via Clang -Wconditional-uninitialized on an x86_64 allyesconfig
build. Verified by building sound/soc/codecs/tas2781-fmwlib.o with
LLVM=1 W=1 (-Werror) and -Wconditional-uninitialized; not
runtime-tested on TAS2781 hardware.

Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib")
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
sound/soc/codecs/tas2781-fmwlib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c
index e6429b4c8dc5..a5e6734723ab 100644
--- a/sound/soc/codecs/tas2781-fmwlib.c
+++ b/sound/soc/codecs/tas2781-fmwlib.c
@@ -897,7 +897,7 @@ static int tasdevice_process_block(void *context, unsigned char *data,
unsigned char dev_idx, int sublocksize)
{
struct tasdevice_priv *tas_priv = (struct tasdevice_priv *)context;
- int subblk_offset, chn, chnend, rc;
+ int subblk_offset = 0, chn, chnend, rc;
unsigned char subblk_typ = data[1];
int blktyp = dev_idx & 0xC0;
int idx = dev_idx & 0x3F;
--
2.56.1.708.g77570a6a1d-goog