drm/virtio: free virtqueues on probe failure

We should call virtio_gpu_deinit() to free virtqueues when
drm_dev_register() failed.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20210517084913.403-3-xieyongji@bytedance.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Xie Yongji 2021-05-17 16:49:13 +08:00 committed by Gerd Hoffmann
parent cec7f17746
commit 058acb33d1

View File

@ -125,11 +125,13 @@ static int virtio_gpu_probe(struct virtio_device *vdev)
ret = drm_dev_register(dev, 0);
if (ret)
goto err_free;
goto err_deinit;
drm_fbdev_generic_setup(vdev->priv, 32);
return 0;
err_deinit:
virtio_gpu_deinit(dev);
err_free:
drm_dev_put(dev);
return ret;