]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 08:00:46 +0000 (10:00 +0200)
commit7f1e98ebdba1f917663d3843693d4e2a96a9f9c3
tree3ee73a2b78ec26302420eae3c15dac99d1b40f5c
parenta6344771ce842aa20ea13e88aab666297f74c64c
drm/virtio: Fix double free on probe failure

[ Upstream commit cec7f1774605a5ef47c134af62afe7c75c30b0ee ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/virtio/virtgpu_kms.c