On Wed, Dec 24, 2025 at 4:11 AM Haoxiang Li <[email protected]> wrote:
>
> In vmw_compat_shader_add(), the return value check of vmw_shader_alloc()
> is not proper. Modify the check for the return pointer 'res'.
>
> Found by code review and compiled on ubuntu 20.04.
>
> Fixes: 18e4a4669c50 ("drm/vmwgfx: Fix compat shader namespace")
> Cc: [email protected]
> Signed-off-by: Haoxiang Li <[email protected]>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_shader.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c 
> b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> index 69dfe69ce0f8..7ed938710342 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
> @@ -923,8 +923,10 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv,
>         ttm_bo_unreserve(&buf->tbo);
>
>         res = vmw_shader_alloc(dev_priv, buf, size, 0, shader_type);
> -       if (unlikely(ret != 0))
> +       if (IS_ERR(res)) {
> +               ret = PTR_ERR(res);
>                 goto no_reserve;
> +       }
>
>         ret = vmw_cmdbuf_res_add(man, vmw_cmdbuf_res_shader,
>                                  vmw_shader_key(user_key, shader_type),
> --
> 2.25.1
>

Thanks, looks good. I pushed it to drm-misc-fixes.

z

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to