LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fix memory leak dma_declare_coherent_memory()
@ 2007-02-23 10:29 Yoichi Yuasa
  0 siblings, 0 replies; only message in thread
From: Yoichi Yuasa @ 2007-02-23 10:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: yoichi_yuasa, Linux Kernel Mailing List

Hi,

This patch has fixed memory leak in dma_declare_coherent_memory().
When it goes to free1_out, dev->dma_mem has not been freed.

Yoichi

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X generic/Documentation/dontdiff generic-orig/arch/cris/arch-v32/drivers/pci/dma.c generic/arch/cris/arch-v32/drivers/pci/dma.c
--- generic-orig/arch/cris/arch-v32/drivers/pci/dma.c	2007-02-23 19:06:28.355418750 +0900
+++ generic/arch/cris/arch-v32/drivers/pci/dma.c	2007-02-23 19:08:43.311853000 +0900
@@ -111,7 +111,7 @@ int dma_declare_coherent_memory(struct d
 	return DMA_MEMORY_IO;
 
  free1_out:
-	kfree(dev->dma_mem->bitmap);
+	kfree(dev->dma_mem);
  out:
 	return 0;
 }
diff -pruN -X generic/Documentation/dontdiff generic-orig/arch/i386/kernel/pci-dma.c generic/arch/i386/kernel/pci-dma.c
--- generic-orig/arch/i386/kernel/pci-dma.c	2007-02-23 19:06:30.183533000 +0900
+++ generic/arch/i386/kernel/pci-dma.c	2007-02-23 19:07:28.475176000 +0900
@@ -110,7 +110,7 @@ int dma_declare_coherent_memory(struct d
 	return DMA_MEMORY_IO;
 
  free1_out:
-	kfree(dev->dma_mem->bitmap);
+	kfree(dev->dma_mem);
  out:
 	if (mem_base)
 		iounmap(mem_base);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-23 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23 10:29 [PATCH] fix memory leak dma_declare_coherent_memory() Yoichi Yuasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).