lkml.org 
[lkml]   [2012]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] lib/dma-debug.c: fix __hash_bucket_find
Date
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


\
 
 \ /
  Last update: 2012-10-18 18:21    [W:0.045 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site