mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kmalloc() bug in pci-dma.c
@ 2005-02-12  1:24 Venkatesh Pallipadi
  2005-02-12  1:32 ` Andrew Morton
  2005-02-12 15:11 ` James Bottomley
  0 siblings, 2 replies; 3+ messages in thread
From: Venkatesh Pallipadi @ 2005-02-12  1:24 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, James.Bottomley


After burning my fingers with a similar mistake in one of the patches 
that I am working on, I did a quick grep to find out all faulty kmalloc() 
calls and found this.

dma_declare_coherent_memory() is calling kmalloc with wrong arguments. 
Attached patch fixes this.

Please apply.

Thanks,
Venki

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>

--- linux-2.6.10/arch/i386/kernel/pci-dma.c.org	2005-02-11 15:18:42.596362296 -0800
+++ linux-2.6.10/arch/i386/kernel/pci-dma.c	2005-02-11 15:19:18.446912184 -0800
@@ -89,11 +89,11 @@ int dma_declare_coherent_memory(struct d
 	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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kmalloc() bug in pci-dma.c
  2005-02-12  1:24 [PATCH] kmalloc() bug in pci-dma.c Venkatesh Pallipadi
@ 2005-02-12  1:32 ` Andrew Morton
  2005-02-12 15:11 ` James Bottomley
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2005-02-12  1:32 UTC (permalink / raw)
  To: Venkatesh Pallipadi; +Cc: linux-kernel, James.Bottomley

Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> wrote:
>
>  After burning my fingers with a similar mistake in one of the patches 
>  that I am working on, I did a quick grep to find out all faulty kmalloc() 
>  calls and found this.
> 
>  dma_declare_coherent_memory() is calling kmalloc with wrong arguments. 
>  Attached patch fixes this.
> 
>  Please apply.
> 
>  Thanks,
>  Venki
> 
>  Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> 
>  --- linux-2.6.10/arch/i386/kernel/pci-dma.c.org	2005-02-11 15:18:42.596362296 -0800
>  +++ linux-2.6.10/arch/i386/kernel/pci-dma.c	2005-02-11 15:19:18.446912184 -0800
>  @@ -89,11 +89,11 @@ int dma_declare_coherent_memory(struct d
>   	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);

erp.  I'll add that to the 2.6.11 queue, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kmalloc() bug in pci-dma.c
  2005-02-12  1:24 [PATCH] kmalloc() bug in pci-dma.c Venkatesh Pallipadi
  2005-02-12  1:32 ` Andrew Morton
@ 2005-02-12 15:11 ` James Bottomley
  1 sibling, 0 replies; 3+ messages in thread
From: James Bottomley @ 2005-02-12 15:11 UTC (permalink / raw)
  To: Venkatesh Pallipadi; +Cc: Andrew Morton, Linux Kernel

On Fri, 2005-02-11 at 17:24 -0800, Venkatesh Pallipadi wrote:
> After burning my fingers with a similar mistake in one of the patches 
> that I am working on, I did a quick grep to find out all faulty kmalloc() 
> calls and found this.
> 
> dma_declare_coherent_memory() is calling kmalloc with wrong arguments. 
> Attached patch fixes this.

Oh Wow, did I really do that ... brown paper bag time for me, I suppose.

> Please apply.

Andrew, please put it in.

James



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-12 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-12  1:24 [PATCH] kmalloc() bug in pci-dma.c Venkatesh Pallipadi
2005-02-12  1:32 ` Andrew Morton
2005-02-12 15:11 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®