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

Skip to content
Commit d8990aa2 authored by Xiaozhe Shi's avatar Xiaozhe Shi
Browse files

power: batterydata-lib: fix out of bound errors



If the battery data lookup tables are misconfigured, there can exist an
array index out of bound error when doing ocv or scaling factor
interpolation using the batterydata-lib functions.

This can happen when the pc being looked up is below the minimum pc
provided by the lookup table. Fix this by not running the search loop if
the pc is out of bounds and instead just return the lowest possible
looked up value.

Change-Id: Ib87925c73576eccb3cdb736229daee12b444964b
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 47d53bf2
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