On Fri, Oct 31, 2025 at 05:03:18PM +0100, Boris Brezillon wrote:
> 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.
> 
> v2:
> - Fix typos
> - Add R-b
> 
> Fixes: 7d9c3442b02a ("drm/panthor: Defer scheduler entitiy destruction to 
> queue release")
> Reviewed-by: Adrián Larumbe <[email protected]>
> Signed-off-by: Boris Brezillon <[email protected]>

Reviewed-by: Liviu Dudau <[email protected]>

Best regards,
Liviu

> ---
>  drivers/gpu/drm/panthor/panthor_sched.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c 
> b/drivers/gpu/drm/panthor/panthor_sched.c
> index 33e04208db31..e0f5b9171320 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -913,7 +913,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);
> -- 
> 2.51.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

Reply via email to