From: Oded Gabbay <oded.gabbay@amd.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter
Date: Thu, 29 Jan 2015 10:35:26 +0200 [thread overview]
Message-ID: <1422520526-11272-3-git-send-email-oded.gabbay@amd.com> (raw)
In-Reply-To: <1422520526-11272-1-git-send-email-oded.gabbay@amd.com>
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 <oded.gabbay@amd.com>
Reviewed-by: Ben Goz <ben.goz@amd.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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 f37cf5e..2fda1927 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;
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-01-29 8:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 8:35 [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Oded Gabbay
2015-01-29 8:35 ` [PATCH 2/3] drm/amdkfd: max num of queues can't be 0 Oded Gabbay
2015-01-29 8:35 ` Oded Gabbay [this message]
2015-01-29 9:54 ` [PATCH 3/3] drm/amdkfd: Don't create BUG due to incorrect user parameter Zhou, Jammy
2015-01-29 15:55 ` [PATCH 1/3] drm/amdkfd: Fix bug in accounting of queues Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422520526-11272-3-git-send-email-oded.gabbay@amd.com \
--to=oded.gabbay@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox