]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ACPI: acpi_pci_link_set() can allocate with either GFP_ATOMIC or GFP_KERNEL
authorJiri Kosina <jikos@jikos.cz>
Thu, 24 Aug 2006 04:36:19 +0000 (00:36 -0400)
committerLen Brown <len.brown@intel.com>
Sat, 14 Oct 2006 05:54:21 +0000 (01:54 -0400)
acpi_pci_link_set() allocates both with interrupts on
and with interrupts off (resume-time), so check interrupts
and decide on GFP_ATOMIC or GFP_KERNEL at run-time.

Signed-off-by: Jiri Kosina <jikos@jikos.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/pci_link.c

index 7f3e7e77e79436e9984c52a4d6c80345f3f3265d..d53bd9878ca2ccddcee6cde058d8781c74b698ba 100644 (file)
@@ -307,7 +307,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
        if (!link || !irq)
                return -EINVAL;
 
-       resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
+       resource = kmalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
        if (!resource)
                return -ENOMEM;