diff options
author | Jenny Ho <hsiufangho@google.com> | 2024-04-10 14:42:45 +0800 |
---|---|---|
committer | Spade Lee <spadelee@google.com> | 2024-04-12 01:07:02 +0000 |
commit | ff6e26adc89d35a83328668771fc9de98873eacd (patch) | |
tree | 268cfd87710b04ad6ca3f143828a228542df8221 | |
parent | b5e49d64144884d54411e24e0a0a92bf63b3bbf7 (diff) | |
download | bms-android-gs-shusky-5.15-android15-beta.tar.gz |
google_bms: fix idx size overflowandroid-15-beta-2_r0.8android-15-beta-2_r0.7android-gs-shusky-5.15-android15-betaandroid-gs-akita-5.15-android15-beta
Bug: 333629531
Change-Id: I16f8b5259106b5f7dbfc7b16d896174d1a3fa206
Signed-off-by: Jenny Ho <hsiufangho@google.com>
(cherry picked from commit 11a05eccc1df6e819bc4290ec0b06c64253bafeb)
-rw-r--r-- | google_bms.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/google_bms.c b/google_bms.c index 03f1987..066c0b3 100644 --- a/google_bms.c +++ b/google_bms.c @@ -323,7 +323,7 @@ int gbms_aacr_fade10(const struct gbms_chg_profile *profile, int cycles) if (profile->aacr_nb_limits == 0 || cycles < 0) return -EINVAL; - for (idx = 0; idx < profile->aacr_nb_limits; idx++) + for (idx = 0; idx < profile->aacr_nb_limits - 1; idx++) if (cycles < profile->reference_cycles[idx]) break; |