drm/sched: Remove redundant check
authorVladislav Efanov <VEfanov@ispras.ru>
Wed, 17 May 2023 12:52:47 +0000 (15:52 +0300)
committerLuben Tuikov <luben.tuikov@amd.com>
Fri, 19 May 2023 13:39:05 +0000 (09:39 -0400)
The rq pointer points inside the drm_gpu_scheduler structure. Thus
it can't be NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: c61cdbdbffc1 ("drm/scheduler: Fix hang when sched_entity released")
Signed-off-by: Vladislav Efanov <VEfanov@ispras.ru>
Link: https://lore.kernel.org/r/20230517125247.434103-1-VEfanov@ispras.ru
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
drivers/gpu/drm/scheduler/sched_main.c

index 8c183639603ec49a4efbcfa9b296ea9cea65d6f9..aea5a90ff98b98f8836417b46cbe628fc40aa680 100644 (file)
@@ -1141,9 +1141,6 @@ void drm_sched_fini(struct drm_gpu_scheduler *sched)
        for (i = DRM_SCHED_PRIORITY_COUNT - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) {
                struct drm_sched_rq *rq = &sched->sched_rq[i];
 
-               if (!rq)
-                       continue;
-
                spin_lock(&rq->lock);
                list_for_each_entry(s_entity, &rq->entities, list)
                        /*