Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a66aa704d6f332b001dfb0e787c92b2c61c75081
Commit:     a66aa704d6f332b001dfb0e787c92b2c61c75081
Parent:     6ae384884d936cb39ab20238af34689933e44525
Author:     Kenji Kaneshige <[EMAIL PROTECTED]>
AuthorDate: Tue May 22 10:20:36 2007 -0700
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Tue May 22 10:20:36 2007 -0700

    [IA64] fix kmalloc(0) in arch/ia64/pci/pci.c
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/pci/pci.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 3549f3b..73696b4 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -354,10 +354,13 @@ pci_acpi_scan_root(struct acpi_device *device, int 
domain, int bus)
 
        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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to