Skip to content

Commit

Permalink
[PATCH] fix memory leak in dma_declare_coherent_memory()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yoichi Yuasa authored and Linus Torvalds committed Mar 1, 2007
1 parent 17f0cd2 commit 3a0ee2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/cris/arch-v32/drivers/pci/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3a0ee2c

Please sign in to comment.