From: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, James.Bottomley@SteelEye.com
Subject: [PATCH] kmalloc() bug in pci-dma.c
Date: Fri, 11 Feb 2005 17:24:39 -0800 [thread overview]
Message-ID: <20050211172439.A21261@unix-os.sc.intel.com> (raw)
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);
next reply other threads:[~2005-02-12 1:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-12 1:24 Venkatesh Pallipadi [this message]
2005-02-12 1:32 ` Andrew Morton
2005-02-12 15:11 ` James Bottomley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050211172439.A21261@unix-os.sc.intel.com \
--to=venkatesh.pallipadi@intel.com \
--cc=James.Bottomley@SteelEye.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®