summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJing Xiangfeng <jingxiangfeng@huawei.com>2021-10-09 17:09:20 +0800
committerGerd Hoffmann <kraxel@redhat.com>2021-10-11 11:16:45 +0200
commita63f393dd7e1ebee707c9dee1d197fdc33d6486b (patch)
tree30bd255453a6de920d668fbeed2127751ea2a451 /drivers
parent914b6f290beb0cf056d75badffa78df6e3dfb058 (diff)
drm/virtio: fix the missed drm_gem_object_put() in virtio_gpu_user_framebuffer_create()
virtio_gpu_user_framebuffer_create() misses to call drm_gem_object_put() in an error path. Add the missed function call to fix it. Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com> Link: http://patchwork.freedesktop.org/patch/msgid/1633770560-11658-1-git-send-email-jingxiangfeng@huawei.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_display.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
index a6caebd4a0dd..5b00310ac4cd 100644
--- a/drivers/gpu/drm/virtio/virtgpu_display.c
+++ b/drivers/gpu/drm/virtio/virtgpu_display.c
@@ -308,8 +308,10 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev,
return ERR_PTR(-EINVAL);
virtio_gpu_fb = kzalloc(sizeof(*virtio_gpu_fb), GFP_KERNEL);
- if (virtio_gpu_fb == NULL)
+ if (virtio_gpu_fb == NULL) {
+ drm_gem_object_put(obj);
return ERR_PTR(-ENOMEM);
+ }
ret = virtio_gpu_framebuffer_init(dev, virtio_gpu_fb, mode_cmd, obj);
if (ret) {