Commit 168a328f30e9d1a8bc6ff55c0501e0bdc08bee60

Authored by Jiri Kosina
Committed by Len Brown
1 parent 786f18c666

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: Jiri Kosina <jikos@jikos.cz>
Signed-off-by: Len Brown <len.brown@intel.com>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/acpi/pci_link.c
... ... @@ -307,7 +307,7 @@
307 307 if (!link || !irq)
308 308 return -EINVAL;
309 309  
310   - resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);
  310 + resource = kmalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
311 311 if (!resource)
312 312 return -ENOMEM;
313 313