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:06:17 +0000 |
commit | dfc81c31eea826a81203d3a03cac80d40ca19451 (patch) | |
tree | 17c2511faea62579c76fa979bd267ddf3b77eefc | |
parent | 46f2409572f47d1f7926c919058c0427394c57ed (diff) | |
download | bms-android-gs-raviole-5.10-android15-beta.tar.gz |
google_bms: fix idx size overflowandroid-15-beta-2_r0.5android-15-beta-2_r0.2android-15-beta-2_r0.1android-gs-raviole-5.10-android15-betaandroid-gs-felix-5.10-android15-betaandroid-gs-bluejay-5.10-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 fc2f171..992da87 100644 --- a/google_bms.c +++ b/google_bms.c @@ -275,7 +275,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; |