]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/vmwgfx: Handle surface check failure correctly
authorNikolay Kuratov <kniv@yandex-team.ru>
Wed, 2 Oct 2024 12:24:29 +0000 (15:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Oct 2024 13:40:43 +0000 (15:40 +0200)
commit572006a05eaae0cb78912124f9e679df1bc058d6
tree8db42f5464ec8fa04264d796d00f0a1c1afad50a
parentfda5dc80121b12871dc343ab37e0c3f0d138825d
drm/vmwgfx: Handle surface check failure correctly

commit 26498b8d54373d31a621d7dec95c4bd842563b3b upstream.

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: 810b3e1683d0 ("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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c