mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
ASoC: codecs: avoid possible garbage value in peb2466_reg_read()
[ Upstream commit38cc0334ba
] Clang static checker (scan-build) warning: sound/soc/codecs/peb2466.c:232:8: Assigned value is garbage or undefined [core.uninitialized.Assign] 232 | *val = tmp; | ^ ~~~ When peb2466_read_byte() fails, 'tmp' will have a garbage value. Add a judgemnet to avoid this problem. Fixes:227f609c7c
("ASoC: codecs: Add support for the Infineon PEB2466 codec") Signed-off-by: Su Hui <suhui@nfschina.com> Link: https://patch.msgid.link/20240911115448.277828-1-suhui@nfschina.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
86238603c8
commit
6ec7cbc7f5
|
@ -229,7 +229,8 @@ static int peb2466_reg_read(void *context, unsigned int reg, unsigned int *val)
|
|||
case PEB2466_CMD_XOP:
|
||||
case PEB2466_CMD_SOP:
|
||||
ret = peb2466_read_byte(peb2466, reg, &tmp);
|
||||
*val = tmp;
|
||||
if (!ret)
|
||||
*val = tmp;
|
||||
break;
|
||||
default:
|
||||
dev_err(&peb2466->spi->dev, "Not a XOP or SOP command\n");
|
||||
|
|
Loading…
Reference in New Issue
Block a user