From: Ming Lei <ming.lei@canonical.com>
To: linux-kernel@vger.kernel.org
Cc: Ming Lei <ming.lei@canonical.com>,
Joerg Roedel <joerg.roedel@amd.com>,
Shuah Khan <shuah.khan@hp.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jakub Kicinski <kubakici@wp.pl>
Subject: [PATCH] lib/dma-debug.c: fix __hash_bucket_find
Date: Thu, 18 Oct 2012 23:38:19 +0800 [thread overview]
Message-ID: <1350574699-6419-1-git-send-email-ming.lei@canonical.com> (raw)
If there is only one match, the unique matched entry should be returned.
Without the fix, the commit f62566214fe31c9f9b3218a42f1b19e6a9e6844a
dma-debug: new interfaces to debug dma mapping errors
can't work reliably because only device and dma_addr are passed to
dma_mapping_error().
Cc: Joerg Roedel <joerg.roedel@amd.com>
Cc: Shuah Khan <shuah.khan@hp.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
lib/dma-debug.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 94aa94e..be132f3 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -283,6 +283,10 @@ static struct dma_debug_entry *__hash_bucket_find(struct hash_bucket *bucket,
if (!match(ref, entry))
continue;
+ /* record the first match */
+ if (!ret)
+ ret = entry;
+
/*
* Some drivers map the same physical address multiple
* times. Without a hardware IOMMU this results in the
--
1.7.9.5
next reply other threads:[~2012-10-18 15:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 15:38 Ming Lei [this message]
2012-10-18 15:53 ` Ming Lei
2012-10-18 17:20 ` Shuah Khan
2012-10-19 1:13 ` Ming Lei
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=1350574699-6419-1-git-send-email-ming.lei@canonical.com \
--to=ming.lei@canonical.com \
--cc=akpm@linux-foundation.org \
--cc=joerg.roedel@amd.com \
--cc=kubakici@wp.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=shuah.khan@hp.com \
/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
all inboxes | Powered by JetHome®