Commit 168a328f authored by Jiri Kosina's avatar Jiri Kosina Committed by Len Brown

ACPI: acpi_pci_link_set() can allocate with either GFP_ATOMIC or GFP_KERNEL

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: default avatarJiri Kosina <jikos@jikos.cz>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 786f18c6
...@@ -307,7 +307,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) ...@@ -307,7 +307,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
if (!link || !irq) if (!link || !irq)
return -EINVAL; return -EINVAL;
resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC); resource = kmalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
if (!resource) if (!resource)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment