[PATCH] fix memory leak in dma_declare_coherent_memory()
authorYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Thu, 1 Mar 2007 04:13:51 +0000 (20:13 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 1 Mar 2007 22:53:39 +0000 (14:53 -0800)
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>
arch/cris/arch-v32/drivers/pci/dma.c
arch/i386/kernel/pci-dma.c

index 426b09878a05a5256c2fbc6ab3067a35c4726ccf..70d3bf0c92e8ebdda3c5d56bcb3663cfe6dc7ffc 100644 (file)
@@ -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;
 }
index 41af692c1584908b6864356b757294b64b787de2..3ebcea033623e357904d52195d4d52d526267636 100644 (file)
@@ -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);