linux/sound/soc/sh
Dan Carpenter 4543b1b8f8 ASoC: renesas: rz-ssi: Add a check for negative sample_space
[ Upstream commit 82a0a3e6f8 ]

My static checker rule complains about this code.  The concern is that
if "sample_space" is negative then the "sample_space >= runtime->channels"
condition will not work as intended because it will be type promoted to a
high unsigned int value.

strm->fifo_sample_size is SSI_FIFO_DEPTH (32).  The SSIFSR_TDC_MASK is
0x3f.  Without any further context it does seem like a reasonable warning
and it can't hurt to add a check for negatives.

Cc: stable@vger.kernel.org
Fixes: 03e786bd43 ("ASoC: sh: Add RZ/G2L SSIF-2 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/e07c3dc5-d885-4b04-a742-71f42243f4fd@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-02-27 04:30:15 -08:00
..
rcar ASoC: rsnd: Fix probe failure on HiHope boards due to endpoint parsing 2024-10-11 12:06:49 +01:00
dma-sh7760.c ASoC: convert asoc_xxx() to snd_soc_xxx() 2023-09-26 15:16:52 +02:00
fsi.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
hac.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
Kconfig ASoC: rsnd: use pcm_dmaengine code 2024-07-30 13:29:52 +01:00
Makefile ASoC: sh: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:29 +09:00
migor.c ASoC: sh: convert not to use asoc_xxx() 2023-09-25 14:16:15 +02:00
rz-ssi.c ASoC: renesas: rz-ssi: Add a check for negative sample_space 2025-02-27 04:30:15 -08:00
sh7760-ac97.c ASoC: sh: sh7760-ac97: use modern dai_link style 2019-06-06 21:37:35 +01:00
siu.h ASoC: siu: Fix build error by a wrong const prefix 2021-01-27 12:35:18 +00:00
siu_dai.c ASoC: Switch back to struct platform_driver::remove() 2024-09-09 18:26:49 +01:00
siu_pcm.c ASoC: sh: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:22 +01:00
ssi.c ASoC: sh: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:22 +01:00