]> git.hungrycats.org Git - linux/commitdiff
[PATCH] kmalloc() bug in pci-dma.c
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Fri, 11 Feb 2005 10:03:23 +0000 (02:03 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 11 Feb 2005 10:03:23 +0000 (02:03 -0800)
dma_declare_coherent_memory() is calling kmalloc with wrong arguments.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/pci-dma.c

index 81f6cf41a8659f1577b34d4beea87d74989bf3f9..7087b1415f64cab3d08103bea2027f0396358e15 100644 (file)
@@ -89,11 +89,11 @@ int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
        if (!mem_base)
                goto out;
 
-       dev->dma_mem = kmalloc(GFP_KERNEL, sizeof(struct dma_coherent_mem));
+       dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL);
        if (!dev->dma_mem)
                goto out;
        memset(dev->dma_mem, 0, sizeof(struct dma_coherent_mem));
-       dev->dma_mem->bitmap = kmalloc(GFP_KERNEL, bitmap_size);
+       dev->dma_mem->bitmap = kmalloc(bitmap_size, GFP_KERNEL);
        if (!dev->dma_mem->bitmap)
                goto free1_out;
        memset(dev->dma_mem->bitmap, 0, bitmap_size);