summaryrefslogtreecommitdiffstats
path: root/lib/dma-debug.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-03-19 10:39:31 +0900
committerIngo Molnar <mingo@elte.hu>2009-03-19 08:39:48 +0100
commit35d40952dba7b0689a16bd1463fb7698f8dbe639 (patch)
tree54020722e333174009f7f588b3960dd32026b03a /lib/dma-debug.c
parent84be58d4601c86306cd939ebf58a9b90989883a4 (diff)
downloadlinux-35d40952dba7b0689a16bd1463fb7698f8dbe639.tar.gz
linux-35d40952dba7b0689a16bd1463fb7698f8dbe639.tar.bz2
linux-35d40952dba7b0689a16bd1463fb7698f8dbe639.zip
dma-debug: warn of unmapping an invalid dma address
Impact: extend DMA-debug checks Calling dma_unmap families against an invalid dma address should be a bug. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Joerg Roedel <joerg.roedel@amd.com> LKML-Reference: <20090319103743N.fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib/dma-debug.c')
-rw-r--r--lib/dma-debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 9a350b414a50..f9e6d38b4b34 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -531,8 +531,11 @@ static void check_unmap(struct dma_debug_entry *ref)
struct hash_bucket *bucket;
unsigned long flags;
- if (dma_mapping_error(ref->dev, ref->dev_addr))
+ if (dma_mapping_error(ref->dev, ref->dev_addr)) {
+ err_printk(ref->dev, NULL, "DMA-API: device driver tries "
+ "to free an invalid DMA memory address\n");
return;
+ }
bucket = get_hash_bucket(ref, &flags);
entry = hash_bucket_find(bucket, ref);