mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
drm/vmwgfx: Fix an error return check in vmw_compat_shader_add()
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: 18e4a4669c ("drm/vmwgfx: Fix compat shader namespace")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patch.msgid.link/20251224091105.1569464-1-lihaoxiang@isrc.iscas.ac.cn
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user