On 1/7/26 21:27, [email protected] wrote:
> diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c 
> b/drivers/gpu/drm/virtio/virtgpu_object.c
> index e6363c887500..8e8a8ec4a361 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_object.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_object.c
> @@ -65,6 +65,12 @@ void virtio_gpu_cleanup_object(struct virtio_gpu_object 
> *bo)
>  {
>       struct virtio_gpu_device *vgdev = bo->base.base.dev->dev_private;
>  
> +     if (!list_empty(&bo->restore_node)) {
> +             mutex_lock(&vgdev->obj_restore_lock);
> +             list_del(&bo->restore_node);
> +             mutex_unlock(&vgdev->obj_restore_lock);
> +     }

This looks fragile to me, I'd use list_del_init() unconditionally.

Also, looks wrong to delete object's node from the list by the
virtio_gpu_cleanup_object() that is invoked from cmd-completion
callback. You calling virtio_gpu_object_unref_all() that walks up
obj_restore_list while obj already may be in process of async unref'ing?

-- 
Best regards,
Dmitry

Reply via email to