From c6f50ee42e3aa372d48b4a8c38d3150c83cd4a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konsta=20H=C3=B6ltt=C3=A4?= Date: Tue, 7 Dec 2021 11:34:02 +0200 Subject: [PATCH] gpu: nvgpu: use correct id for rl domain deletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The index for active_runlists is meaningless outside the active_runlists array, and may break on more complex GPUs. Use runlist->id. Jira NVGPU-6425 Change-Id: Ida9d53bd5180f4e5a9fa490b5b957e3b68aa410f Signed-off-by: Konsta Hölttä Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2637930 Reviewed-by: svcacv Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Alex Waterman Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/runlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/common/fifo/runlist.c b/drivers/gpu/nvgpu/common/fifo/runlist.c index 2e9a02d01..ae17bfd52 100644 --- a/drivers/gpu/nvgpu/common/fifo/runlist.c +++ b/drivers/gpu/nvgpu/common/fifo/runlist.c @@ -789,15 +789,15 @@ int nvgpu_rl_domain_delete(struct gk20a *g, const char *name) { struct nvgpu_fifo *f = &g->fifo; u32 i; - struct nvgpu_runlist *runlist; for (i = 0; i < f->num_runlists; i++) { + struct nvgpu_runlist *runlist; struct nvgpu_runlist_domain *domain; runlist = &f->active_runlists[i]; nvgpu_mutex_acquire(&runlist->runlist_lock); - domain = nvgpu_rl_domain_get(g, i, name); + domain = nvgpu_rl_domain_get(g, runlist->id, name); if (domain != NULL) { struct nvgpu_runlist_domain *first; struct nvgpu_runlist_domain *last;