mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: kgsl: Lower bounds check the number of power levels
A misconfigured board file could cause an out-of-bounds array access through this value. Change-Id: I64bbad0c096a2efe65376991537d810141370d72 CRs-Fixed: 439230 Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org> Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
This commit is contained in:
parent
8e426d5e1c
commit
a8ad5085a2
1 changed files with 2 additions and 1 deletions
|
@ -878,7 +878,8 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
|
|||
if (pdata->set_grp_async != NULL)
|
||||
pdata->set_grp_async();
|
||||
|
||||
if (pdata->num_levels > KGSL_MAX_PWRLEVELS) {
|
||||
if (pdata->num_levels > KGSL_MAX_PWRLEVELS ||
|
||||
pdata->num_levels < 1) {
|
||||
KGSL_PWR_ERR(device, "invalid power level count: %d\n",
|
||||
pdata->num_levels);
|
||||
result = -EINVAL;
|
||||
|
|
Loading…
Reference in a new issue