Messages in this thread Patch in this message | | | Date | Fri, 23 Feb 2007 19:29:36 +0900 | From | Yoichi Yuasa <> | Subject | [PATCH] fix memory leak dma_declare_coherent_memory() |
| |
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); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |