Skip to content

Commit 26498b8

Browse files
Nikolay Kuratovzackr
authored andcommitted
drm/vmwgfx: Handle surface check failure correctly
Currently if condition (!bo and !vmw_kms_srf_ok()) was met we go to err_out with ret == 0. err_out dereferences vfb if ret == 0, but in our case vfb is still NULL. Fix this by assigning sensible error to ret. Found by Linux Verification Center (linuxtesting.org) with SVACE Signed-off-by: Nikolay Kuratov <[email protected]> Cc: [email protected] Fixes: 810b3e1 ("drm/vmwgfx: Support topology greater than texture size") Signed-off-by: Zack Rusin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 512a972 commit 26498b8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_kms.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,7 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
15101510
DRM_ERROR("Surface size cannot exceed %dx%d\n",
15111511
dev_priv->texture_max_width,
15121512
dev_priv->texture_max_height);
1513+
ret = -EINVAL;
15131514
goto err_out;
15141515
}
15151516

0 commit comments

Comments
 (0)