Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 18d5d63d authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Stephen Boyd
Browse files

of_batterydata: Fix possible divide by 0 conditions



If the Battery ID is either short circuited or floating, the
batterydata loading may cause a divide by 0 warning when calculating
the Battery ID resistance.

Fix this by checking for 0 denominators before doing the divisions
and returning 0 kOhms for the Battery ID resistance.

Change-Id: Ia631d8bdbdf6be838c7cfe2ea9601da9dea45636
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 4307f3e7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment