Skip to content
Verified Commit 63c1c879 authored by Luo Yifan's avatar Luo Yifan Committed by Mark Brown
Browse files

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



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: default avatarLuo Yifan <luoyifan@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241106014654.206860-1-luoyifan@cmss.chinamobile.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8c21e40e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment