[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:
committed by
Linus Torvalds
parent
17f0cd2f35
commit
3a0ee2ce8c
@@ -111,7 +111,7 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
|
|||||||
return DMA_MEMORY_IO;
|
return DMA_MEMORY_IO;
|
||||||
|
|
||||||
free1_out:
|
free1_out:
|
||||||
kfree(dev->dma_mem->bitmap);
|
kfree(dev->dma_mem);
|
||||||
out:
|
out:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -110,7 +110,7 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
|
|||||||
return DMA_MEMORY_IO;
|
return DMA_MEMORY_IO;
|
||||||
|
|
||||||
free1_out:
|
free1_out:
|
||||||
kfree(dev->dma_mem->bitmap);
|
kfree(dev->dma_mem);
|
||||||
out:
|
out:
|
||||||
if (mem_base)
|
if (mem_base)
|
||||||
iounmap(mem_base);
|
iounmap(mem_base);
|
||||||
|
Reference in New Issue
Block a user