Commit 4b61f684 authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] on SCI allocation failure, don't mistakenly free IRQ0

	from Jes Sorensen
parent b6655cd4
...@@ -258,13 +258,13 @@ acpi_os_install_interrupt_handler(u32 irq, OSD_HANDLER handler, void *context) ...@@ -258,13 +258,13 @@ acpi_os_install_interrupt_handler(u32 irq, OSD_HANDLER handler, void *context)
return AE_OK; return AE_OK;
} }
#endif #endif
acpi_irq_irq = irq;
acpi_irq_handler = handler; acpi_irq_handler = handler;
acpi_irq_context = context; acpi_irq_context = context;
if (request_irq(irq, acpi_irq, SA_SHIRQ, "acpi", acpi_irq)) { if (request_irq(irq, acpi_irq, SA_SHIRQ, "acpi", acpi_irq)) {
printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq); printk(KERN_ERR PREFIX "SCI (IRQ%d) allocation failed\n", irq);
return AE_NOT_ACQUIRED; return AE_NOT_ACQUIRED;
} }
acpi_irq_irq = irq;
return AE_OK; return AE_OK;
} }
...@@ -272,12 +272,13 @@ acpi_os_install_interrupt_handler(u32 irq, OSD_HANDLER handler, void *context) ...@@ -272,12 +272,13 @@ acpi_os_install_interrupt_handler(u32 irq, OSD_HANDLER handler, void *context)
acpi_status acpi_status
acpi_os_remove_interrupt_handler(u32 irq, OSD_HANDLER handler) acpi_os_remove_interrupt_handler(u32 irq, OSD_HANDLER handler)
{ {
if (acpi_irq_handler) { if (irq) {
#ifdef CONFIG_IA64 #ifdef CONFIG_IA64
irq = acpi_irq_to_vector(irq); irq = acpi_irq_to_vector(irq);
#endif #endif
free_irq(irq, acpi_irq); free_irq(irq, acpi_irq);
acpi_irq_handler = NULL; acpi_irq_handler = NULL;
acpi_irq_irq = 0;
} }
return AE_OK; return AE_OK;
......
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