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

[ Upstream commit 63c1c87993 ]

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 (*prate / div) is safe to perform.

Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241106014654.206860-1-luoyifan@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Luo Yifan 2024-11-06 09:46:54 +08:00 • committed by Greg Kroah-Hartman
commit d525fc9424