From: Dan Carpenter Date: Tue, 25 Nov 2014 10:24:51 +0000 (+0300) Subject: amdkfd: fix an error handling bug in pqm_create_queue() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e048a0b26033b35eb36c20e4d36fb466a2570c27;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Dan Carpenter Signed-off-by: Oded Gabbay --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index de2c16345693..47526780d736 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/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;