Commit 39caef09 authored by Xiaomeng Tong's avatar Xiaomeng Tong Committed by Greg Kroah-Hartman
Browse files

virtio-gpu: fix a missing check to avoid NULL dereference



[ Upstream commit bd63f11f ]

'cache_ent' could be set NULL inside virtio_gpu_cmd_get_capset()
and it will lead to a NULL dereference by a lately use of it
(i.e., ptr = cache_ent->caps_cache). Fix it with a NULL check.

Fixes: 62fb7a5e ("virtio-gpu: add 3d/virgl support")
Signed-off-by: default avatarXiaomeng Tong <xiam0nd.tong@gmail.com>
Reviewed-by: default avatarChia-I Wu <olvaffe@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20220327050945.1614-1-xiam0nd.tong@gmail.com



[ kraxel: minor codestyle fixup ]

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c3a1cfd1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment