linux-loongson/sound/soc/stm
Sergio Perez Gonzalez 0ebbab41fb
ASoC: stm: stm32_i2s: Fix calc_clk_div() error handling in determine_rate()
calc_clk_div() will only return a non-zero value (-EINVAL)
in case of error. On the other hand, req->rate is an unsigned long.
It seems quite odd that req->rate would be assigned a negative value,
which is clearly not a rate, and success would be returned.

Reinstate previous logic, which would just return error.

Fixes: afd529d740 ("ASoC: stm: stm32_i2s: convert from round_rate() to determine_rate()")
Link: https://scan7.scan.coverity.com/#/project-view/53936/11354?selectedIssue=1647702

Signed-off-by: Sergio Perez Gonzalez <sperezglz@gmail.com>
Link: https://patch.msgid.link/20250729020052.404617-1-sperezglz@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-08-12 21:15:29 +01:00
..
Kconfig ASoC: stm: Standardize ASoC menu 2025-06-24 01:01:17 +01:00
Makefile ASoC: stm: Use *-y instead of *-objs in Makefile 2024-05-08 11:39:34 +09:00
stm32_adfsdm.c ASoC: stm32: dfsdm: change rate upper limits 2024-11-14 11:42:42 +00:00
stm32_i2s.c ASoC: stm: stm32_i2s: Fix calc_clk_div() error handling in determine_rate() 2025-08-12 21:15:29 +01:00
stm32_sai_sub.c ASoC: stm: stm32_sai_sub: convert from round_rate() to determine_rate() 2025-07-15 13:38:55 +01:00
stm32_sai.c ASoC: stm: stm32_sai: Use dev_err_probe() 2025-04-06 23:25:10 +01:00
stm32_sai.h ASoC: stm32: sai: add stm32mp25 support 2024-11-08 13:32:45 +00:00
stm32_spdifrx.c ASoC: stm: Convert to SYSTEM_SLEEP_PM_OPS() 2025-03-17 10:14:58 +00:00