diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2020-02-05 21:19:49 +0300 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-02-06 13:58:18 +0300 |
commit | 4d8d4869101590909fcf4bdb8fea8a9affdd2b94 (patch) | |
tree | 24cccb03aec5ef404ae18203d873397c53502733 /drivers/gpu/drm/virtio | |
parent | e19d341174b6795577982ad6e2925898d347e841 (diff) | |
download | linux-4d8d4869101590909fcf4bdb8fea8a9affdd2b94.tar.xz |
drm/virtio: unlock object array on errors
We don't propagate erros to the callers. We have to unlock object
arrays on errors.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200205181955.202485-6-olvaffe@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_vq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 7fb09fc4f6a3..0ceceb39f6a4 100644 --- a/drivers/gpu/drm/virtio/virtgpu_vq.c +++ b/drivers/gpu/drm/virtio/virtgpu_vq.c @@ -370,8 +370,11 @@ static void virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev, if (is_vmalloc_addr(vbuf->data_buf)) { sgt = vmalloc_to_sgt(vbuf->data_buf, vbuf->data_size, &outcnt); - if (!sgt) + if (!sgt) { + if (fence && vbuf->objs) + virtio_gpu_array_unlock_resv(vbuf->objs); return; + } vout = sgt->sgl; } else { sg_init_one(&sg, vbuf->data_buf, vbuf->data_size); |