Commit 4d8d4869 authored by Chia-I Wu's avatar Chia-I Wu Committed by Gerd Hoffmann
Browse files

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: default avatarChia-I Wu <olvaffe@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200205181955.202485-6-olvaffe@gmail.com


Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent e19d3411
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -370,8 +370,11 @@ static void virtio_gpu_queue_fenced_ctrl_buffer(struct virtio_gpu_device *vgdev,
		if (is_vmalloc_addr(vbuf->data_buf)) {
		if (is_vmalloc_addr(vbuf->data_buf)) {
			sgt = vmalloc_to_sgt(vbuf->data_buf, vbuf->data_size,
			sgt = vmalloc_to_sgt(vbuf->data_buf, vbuf->data_size,
					     &outcnt);
					     &outcnt);
			if (!sgt)
			if (!sgt) {
				if (fence && vbuf->objs)
					virtio_gpu_array_unlock_resv(vbuf->objs);
				return;
				return;
			}
			vout = sgt->sgl;
			vout = sgt->sgl;
		} else {
		} else {
			sg_init_one(&sg, vbuf->data_buf, vbuf->data_size);
			sg_init_one(&sg, vbuf->data_buf, vbuf->data_size);