]> git.baikalelectronics.ru Git - kernel.git/commit
drm/virtio: Fix double free on probe failure
authorXie Yongji <xieyongji@bytedance.com>
Mon, 17 May 2021 08:49:12 +0000 (16:49 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 18 May 2021 08:55:30 +0000 (10:55 +0200)
commit8b6d0a76db473bb165c1d0fa5073077fab42e5c1
tree9558939082eabe2360067bf4fe0c9a360b27fd78
parent6651c66b484655fdd9b4e4c01adaec7b9f780698
drm/virtio: Fix double free on probe failure

The virtio_gpu_init() will free vgdev and vgdev->vbufs on failure.
But such failure will be caught by virtio_gpu_probe() and then
virtio_gpu_release() will be called to do some cleanup which
will free vgdev and vgdev->vbufs again. So let's set dev->dev_private
to NULL to avoid double free.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20210517084913.403-2-xieyongji@bytedance.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/virtio/virtgpu_kms.c