amdkfd: fix an error handling bug in pqm_create_queue()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 25 Nov 2014 10:24:51 +0000 (13:24 +0300)
committerOded Gabbay <oded.gabbay@amd.com>
Tue, 25 Nov 2014 10:24:51 +0000 (13:24 +0300)
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>
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

index de2c163456935b5cadacf6a784873ae5b3cc1ee8..47526780d736ced5470bfb2822a3892f879b0320 100644 (file)
@@ -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;