mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
drm/virtio: fix possible leak/unlock virtio_gpu_object_array
virtio_gpu_object array is not freed or unlocked in some failed cases. Signed-off-by: xndcn <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
This commit is contained in:
@@ -174,7 +174,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
|
||||
if (!sync_file) {
|
||||
dma_fence_put(&out_fence->f);
|
||||
ret = -ENOMEM;
|
||||
goto out_memdup;
|
||||
goto out_unresv;
|
||||
}
|
||||
|
||||
exbuf->fence_fd = out_fence_fd;
|
||||
|
||||
@@ -248,6 +248,7 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,
|
||||
|
||||
ret = virtio_gpu_object_shmem_init(vgdev, bo, &ents, &nents);
|
||||
if (ret != 0) {
|
||||
virtio_gpu_array_put_free(objs);
|
||||
virtio_gpu_free_object(&shmem_obj->base);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user