From: Oded Gabbay Date: Tue, 20 Jan 2015 12:57:19 +0000 (+0200) Subject: drm/amdkfd: Don't create BUG due to incorrect user parameter X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9dce23ddc949faa8ba138f8a0811e177c991bf1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/amdkfd: Don't create BUG due to incorrect user parameter This patch changes a BUG_ON() statement to pr_debug, in case the user tries to update a non-existing queue. Signed-off-by: Oded Gabbay Reviewed-by: Ben Goz Reviewed-by: Jammy Zhou Reviewed-by: Alex Deucher --- 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 f37cf5efe642..2fda1927bff7 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -315,7 +315,11 @@ int pqm_update_queue(struct process_queue_manager *pqm, unsigned int qid, BUG_ON(!pqm); pqn = get_queue_by_qid(pqm, qid); - BUG_ON(!pqn); + if (!pqn) { + pr_debug("amdkfd: No queue %d exists for update operation\n", + qid); + return -EFAULT; + } pqn->q->properties.queue_address = p->queue_address; pqn->q->properties.queue_size = p->queue_size;