Skip to content

Commit ec32f4f

Browse files
Dan CarpenterThomas Hellström
authored andcommitted
drm/xe: unlock on error path in xe_vm_add_compute_exec_queue()
Drop the "&vm->lock" before returning. Fixes: 24f947d ("drm/xe: Use DRM GPUVM helpers for external- and evicted objects") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> (cherry picked from commit cf46019) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 616576d commit ec32f4f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/xe/xe_vm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,13 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
335335
down_write(&vm->lock);
336336
err = drm_gpuvm_exec_lock(&vm_exec);
337337
if (err)
338-
return err;
338+
goto out_up_write;
339339

340340
pfence = xe_preempt_fence_create(q, q->compute.context,
341341
++q->compute.seqno);
342342
if (!pfence) {
343343
err = -ENOMEM;
344-
goto out_unlock;
344+
goto out_fini;
345345
}
346346

347347
list_add(&q->compute.link, &vm->preempt.exec_queues);
@@ -364,8 +364,9 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
364364

365365
up_read(&vm->userptr.notifier_lock);
366366

367-
out_unlock:
367+
out_fini:
368368
drm_exec_fini(exec);
369+
out_up_write:
369370
up_write(&vm->lock);
370371

371372
return err;

0 commit comments

Comments
 (0)