> 2026年6月26日 23:01,WenTao Liang <[email protected]> 写道:
> 
> ttm_base_object_init unconditionally acquires a base object reference via
>  kref_init. When it fails, the error path in vmw_user_shader_alloc only
>  calls vmw_resource_unreference but never calls ttm_base_object_unref to
>  release the base object reference, causing a refcount leak.
> 
> Add ttm_base_object_unref in the error path to properly release the base
>  object reference when ttm_base_object_init fails.
> 
> Cc: [email protected]
> Fixes: 0b8762e997df ("drm/ttm, drm/vmwgfx: Move the lock- and object 
> functionality to the vmwgfx driver")
> Signed-off-by: WenTao Liang <[email protected]>
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c 
> b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> index eca4e3e97eb4..d82ec43c8901 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> @@ -724,6 +724,7 @@ static int vmw_user_shader_alloc(struct vmw_private 
> *dev_priv,
> 
>       if (unlikely(ret != 0)) {
>               vmw_resource_unreference(&tmp);
> +             ttm_base_object_unref(&ushader->base);
>               goto out_err;
>       }
> 
> -- 
> 2.39.5 (Apple Git-154)

Please ignore this patch. I will resend a proper version after
learning the kernel submission process.

Apologies for the noise.

Best regards,
WenTao Liang

Reply via email to