Commit 3a0ee2ce authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Linus Torvalds

[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: default avatarYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 17f0cd2f
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment