Commit 5fe7bdbe authored by Rand Deeb's avatar Rand Deeb Committed by Greg Kroah-Hartman
Browse files

ssb: Fix division by zero issue in ssb_calc_clock_rate



[ Upstream commit e0b5127f ]

In ssb_calc_clock_rate(), there is a potential issue where the value of
m1 could be zero due to initialization using clkfactor_f6_resolv(). This
situation raised concerns about the possibility of a division by zero
error.

We fixed it by following the suggestions provided by Larry Finger
<Larry.Finger@lwfinger.net> and Michael Büsch <m@bues.ch>. The fix
involves returning a value of 1 instead of 0 in clkfactor_f6_resolv().
This modification ensures the proper functioning of the code and
eliminates the risk of division by zero errors.

Signed-off-by: default avatarRand Deeb <rand.sec96@gmail.com>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Acked-by: default avatarMichael Büsch <m@bues.ch>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230904232346.34991-1-rand.sec96@gmail.com


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