mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
Charge:fix slab out of bounds risk
There is a risk if enum mmi_temp_zones value > num_temp_zones. This will casue pointer point to a illegal memory address. Change-Id: Ifa68a3b5325063d07a3ccddbb8636644a58fe1c6 Reviewed-on: https://gerrit.mot.com/1456222 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hongshu Lou <louhs1@motorola.com> Reviewed-by: Haijian Ma <mahj8@motorola.com> Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
bde9316909
commit
f30ab4d58b
1 changed files with 4 additions and 1 deletions
|
|
@ -2550,7 +2550,10 @@ static void mmi_basic_charge_sm(struct smb_mmi_charger *chip,
|
|||
max_fv_mv = chip->base_fv_mv;
|
||||
|
||||
mmi_find_temp_zone(chip, prm, stat->batt_temp);
|
||||
zone = &prm->temp_zones[prm->pres_temp_zone];
|
||||
if (prm->pres_temp_zone >= chip->num_temp_zones)
|
||||
zone = &prm->temp_zones[0];
|
||||
else
|
||||
zone = &prm->temp_zones[prm->pres_temp_zone];
|
||||
|
||||
if (!stat->charger_present && !is_wls_online(chip)) {
|
||||
prm->pres_chrg_step = STEP_NONE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue