[PATCH] drm/vmwgfx: clean up some error pointer checking

Zack Rusin zackr at vmware.com
Wed Jul 20 13:22:14 UTC 2022


On Tue, 2022-07-19 at 12:47 +0300, Dan Carpenter wrote:
> The vmw_user_bo_noref_lookup() function cannot return NULL.  If it
> could, then this function would return PTR_ERR(NULL) which is success.
> Returning success without initializing "*vmw_bo_p = vmw_bo;" would
> lead to an uninitialized variable bug in the caller.  Smatch complains
> about this:
> 
> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:1177 vmw_translate_mob_ptr() warn: passing zero to 'PTR_ERR'
> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:1314 vmw_cmd_dx_bind_query() error: uninitialized symbol 'vmw_bo'.

Thanks, Dan.

I'll push it through the drm-misc tree.

z


More information about the dri-devel mailing list