Commit 3727c0bf authored by Luo Yifan's avatar Luo Yifan Committed by Greg Kroah-Hartman
Browse files

ASoC: stm: Prevent potential division by zero in stm32_sai_get_clk_div()



[ Upstream commit 23569c8b ]

This patch checks if div is less than or equal to zero (div <= 0). If
div is zero or negative, the function returns -EINVAL, ensuring the
division operation is safe to perform.

Signed-off-by: default avatarLuo Yifan <luoyifan@cmss.chinamobile.com>
Reviewed-by: default avatarOlivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20241107015936.211902-1-luoyifan@cmss.chinamobile.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 80c35a87
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment