diff options
author | Suzanne Candanedo <suzanne.candanedo@arm.com> | 2022-09-27 18:31:54 +0100 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2022-10-06 15:56:49 -0700 |
commit | 825d564553db3985e94a2e69e6168d596e58ec00 (patch) | |
tree | 568016089569f3ad8d740e24f8aa16b139783189 /mali_kbase/mali_kbase_js.c | |
parent | d677f99449d73ecccca9c722cda35043334bfa68 (diff) | |
download | gpu-825d564553db3985e94a2e69e6168d596e58ec00.tar.gz |
mali_kbase: MIDCET-4220 Patch for GPUSWERRATA-1360
This patch is fix for SW errata 2637762 fixing possible
out of bounds array access.
Bug: 251397485
Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/4580
Signed-off-by: Jesse Hall <jessehall@google.com>
Change-Id: Ie8a48bbe903fe1127d298a33b9533753d0763452
Diffstat (limited to 'mali_kbase/mali_kbase_js.c')
-rw-r--r-- | mali_kbase/mali_kbase_js.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mali_kbase/mali_kbase_js.c b/mali_kbase/mali_kbase_js.c index 33af2da..df729f5 100644 --- a/mali_kbase/mali_kbase_js.c +++ b/mali_kbase/mali_kbase_js.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note /* * - * (C) COPYRIGHT 2011-2021 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2011-2022 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -4094,13 +4094,16 @@ base_jd_prio kbase_js_priority_check(struct kbase_device *kbdev, base_jd_prio pr { struct priority_control_manager_device *pcm_device = kbdev->pcm_dev; int req_priority, out_priority; - base_jd_prio out_jd_priority = priority; - if (pcm_device) { - req_priority = kbasep_js_atom_prio_to_sched_prio(priority); - out_priority = pcm_device->ops.pcm_scheduler_priority_check(pcm_device, current, req_priority); - out_jd_priority = kbasep_js_sched_prio_to_atom_prio(out_priority); - } - return out_jd_priority; + req_priority = kbasep_js_atom_prio_to_sched_prio(priority); + out_priority = req_priority; + /* Does not use pcm defined priority check if PCM not defined or if + * kbasep_js_atom_prio_to_sched_prio returns an error + * (KBASE_JS_ATOM_SCHED_PRIO_INVALID). + */ + if (pcm_device && (req_priority != KBASE_JS_ATOM_SCHED_PRIO_INVALID)) + out_priority = pcm_device->ops.pcm_scheduler_priority_check(pcm_device, current, + req_priority); + return kbasep_js_sched_prio_to_atom_prio(kbdev, out_priority); } |