mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
[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:
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;
|
||||
|
||||
free1_out:
|
||||
kfree(dev->dma_mem->bitmap);
|
||||
kfree(dev->dma_mem);
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user