mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -tip] dma-debug: warn of unmapping an invalid dma address
@ 2009-03-19  1:39 FUJITA Tomonori
  2009-03-19  7:42 ` [tip:core/iommu] " FUJITA Tomonori
  0 siblings, 1 reply; 2+ messages in thread
From: FUJITA Tomonori @ 2009-03-19  1:39 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel, joerg.roedel

Calling dma_unmap families against an invalid dma address should be a
bug.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 lib/dma-debug.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 9a350b4..f9e6d38 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);
-- 
1.6.0.6


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-19  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-19  1:39 [PATCH -tip] dma-debug: warn of unmapping an invalid dma address FUJITA Tomonori
2009-03-19  7:42 ` [tip:core/iommu] " FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome