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 <kniv@yandex-team.ru> Cc: stable@vger.kernel.org Fixes: 810b3e1 ("drm/vmwgfx: Support topology greater than texture size") Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241002122429.1981822-1-kniv@yandex-team.ru
1 parent 512a972 commit 26498b8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)