Explorar o código

amdkfd: fix an error handling bug in pqm_create_queue()

The call to kernel_queue_uninit(NULL) will trigger a BUG(), and also the
error code is incorrect.

Fixes: 45102048f77e ('amdkfd: Add process queue manager module')
Reviewed-by: Oded Gabbay <oded.gabbay@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Dan Carpenter %!s(int64=10) %!d(string=hai) anos
pai
achega
e048a0b260
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

+ 1 - 1
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

@@ -208,7 +208,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,
 	case KFD_QUEUE_TYPE_DIQ:
 		kq = kernel_queue_init(dev, KFD_QUEUE_TYPE_DIQ);
 		if (kq == NULL) {
-			kernel_queue_uninit(kq);
+			retval = -ENOMEM;
 			goto err_create_queue;
 		}
 		kq->queue->properties.queue_id = *qid;