]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/panthor: Fix group_free_queue() for partially initialized queues
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 31 Oct 2025 16:03:18 +0000 (17:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:48 +0000 (14:02 +0100)
[ Upstream commit 94a6d20feadbbe24e8a7b1c56394789ea5358fcc ]

group_free_queue() can be called on a partially initialized queue
object if something fails in group_create_queue(). Make sure we don't
call drm_sched_entity_destroy() on an entity that hasn't been
initialized.

Fixes: 7d9c3442b02a ("drm/panthor: Defer scheduler entitiy destruction to queue release")
Reviewed-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251031160318.832427-2-boris.brezillon@collabora.com
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panthor/panthor_sched.c

index 85ef9a7acc1477bafd80b7908b7a75c13a9d129d..a39f0fb370dc61b353a82a894e10b440aeef9509 100644 (file)
@@ -895,7 +895,8 @@ static void group_free_queue(struct panthor_group *group, struct panthor_queue *
        if (IS_ERR_OR_NULL(queue))
                return;
 
-       drm_sched_entity_destroy(&queue->entity);
+       if (queue->entity.fence_context)
+               drm_sched_entity_destroy(&queue->entity);
 
        if (queue->scheduler.ops)
                drm_sched_fini(&queue->scheduler);