[PATCH] fix memory leak in dma_declare_coherent_memory()

When it goes to free1_out, dev->dma_mem has not been freed.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Yoichi Yuasa 2007-02-28 20:13:51 -08:00 committed by Linus Torvalds
parent 17f0cd2f35
commit 3a0ee2ce8c
2 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
return DMA_MEMORY_IO;
free1_out:
kfree(dev->dma_mem->bitmap);
kfree(dev->dma_mem);
out:
return 0;
}

View File

@ -110,7 +110,7 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
return DMA_MEMORY_IO;
free1_out:
kfree(dev->dma_mem->bitmap);
kfree(dev->dma_mem);
out:
if (mem_base)
iounmap(mem_base);