提交 3a0ee2ce 编写于 作者: Y Yoichi Yuasa 提交者: 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: NYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册