projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
644adc3
)
drm/virtio: Fixes a potential NULL pointer dereference on probe failure
author
Xie Yongji
<xieyongji@bytedance.com>
Mon, 17 May 2021 08:49:11 +0000
(16:49 +0800)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 18 May 2021 08:55:30 +0000
(10:55 +0200)
The dev->dev_private might not be allocated if virtio_gpu_pci_quirk()
or virtio_gpu_init() failed. In this case, we should avoid the cleanup
in virtio_gpu_release().
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Link:
http://patchwork.freedesktop.org/patch/msgid/20210517084913.403-1-xieyongji@bytedance.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/virtio/virtgpu_kms.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/virtio/virtgpu_kms.c
b/drivers/gpu/drm/virtio/virtgpu_kms.c
index b375394193be822dcb1d655078e47396c9787b4c..aa532ad31a23bb0b3c4832555cfb481c06a4e074 100644
(file)
--- a/
drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/
drivers/gpu/drm/virtio/virtgpu_kms.c
@@
-264,6
+264,9
@@
void virtio_gpu_release(struct drm_device *dev)
{
struct virtio_gpu_device *vgdev = dev->dev_private;
+ if (!vgdev)
+ return;
+
virtio_gpu_modeset_fini(vgdev);
virtio_gpu_free_vbufs(vgdev);
virtio_gpu_cleanup_cap_cache(vgdev);