From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c
Date: Tue, 22 May 2007 01:23:40 +0000 [thread overview]
Message-ID: <1179797021.3872.6.camel@kane-linux> (raw)
In-Reply-To: <20070517110056.779944a2.kamezawa.hiroyu@jp.fujitsu.com>
Hi,
Here is a patch to fix zero size kmalloc problem that was reported
by Hiroyuki Kamezawa.
Thanks,
Kenji Kaneshige
---
Hiroyuki Kamezawa reported the problem that pci_acpi_scan_root() of
ia64 might call kmalloc_node() with zero size.
Currently ia64's pci_acpi_scan_root() assumes that _CRS method of root
bridge has at least one resource window. But, the root bridges that
has no resource window must be taken into account.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
---
arch/ia64/pci/pci.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
Index: linux-2.6.22-rc1/arch/ia64/pci/pci.c
=================================--- linux-2.6.22-rc1.orig/arch/ia64/pci/pci.c
+++ linux-2.6.22-rc1/arch/ia64/pci/pci.c
@@ -354,10 +354,13 @@ pci_acpi_scan_root(struct acpi_device *d
acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window,
&windows);
- controller->window = kmalloc_node(sizeof(*controller->window) * windows,
- GFP_KERNEL, controller->node);
- if (!controller->window)
- goto out2;
+ if (windows) {
+ controller->window + kmalloc_node(sizeof(*controller->window) * windows,
+ GFP_KERNEL, controller->node);
+ if (!controller->window)
+ goto out2;
+ }
name = kmalloc(16, GFP_KERNEL);
if (!name)
prev parent reply other threads:[~2007-05-22 1:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-17 2:00 [PATCH] fix kmalloc(0) in arch/ia64/pci/pci.c KAMEZAWA Hiroyuki
2007-05-17 19:19 ` Andrew Morton
2007-05-18 0:48 ` KAMEZAWA Hiroyuki
2007-05-22 1:23 ` Kenji Kaneshige [this message]
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=1179797021.3872.6.camel@kane-linux \
--to=kaneshige.kenji@jp.fujitsu.com \
--cc=linux-ia64@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