diff options
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r-- | kernel/irq/manage.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 77a51be36010..ae1b684e048c 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -596,26 +596,29 @@ int request_irq(unsigned int irq, irq_handler_t handler, | |||
596 | action->next = NULL; | 596 | action->next = NULL; |
597 | action->dev_id = dev_id; | 597 | action->dev_id = dev_id; |
598 | 598 | ||
599 | retval = setup_irq(irq, action); | ||
600 | if (retval) | ||
601 | kfree(action); | ||
602 | |||
599 | #ifdef CONFIG_DEBUG_SHIRQ | 603 | #ifdef CONFIG_DEBUG_SHIRQ |
600 | if (irqflags & IRQF_SHARED) { | 604 | if (irqflags & IRQF_SHARED) { |
601 | /* | 605 | /* |
602 | * It's a shared IRQ -- the driver ought to be prepared for it | 606 | * It's a shared IRQ -- the driver ought to be prepared for it |
603 | * to happen immediately, so let's make sure.... | 607 | * to happen immediately, so let's make sure.... |
604 | * We do this before actually registering it, to make sure that | 608 | * We disable the irq to make sure that a 'real' IRQ doesn't |
605 | * a 'real' IRQ doesn't run in parallel with our fake | 609 | * run in parallel with our fake. |
606 | */ | 610 | */ |
607 | unsigned long flags; | 611 | unsigned long flags; |
608 | 612 | ||
613 | disable_irq(irq); | ||
609 | local_irq_save(flags); | 614 | local_irq_save(flags); |
615 | |||
610 | handler(irq, dev_id); | 616 | handler(irq, dev_id); |
617 | |||
611 | local_irq_restore(flags); | 618 | local_irq_restore(flags); |
619 | enable_irq(irq); | ||
612 | } | 620 | } |
613 | #endif | 621 | #endif |
614 | |||
615 | retval = setup_irq(irq, action); | ||
616 | if (retval) | ||
617 | kfree(action); | ||
618 | |||
619 | return retval; | 622 | return retval; |
620 | } | 623 | } |
621 | EXPORT_SYMBOL(request_irq); | 624 | EXPORT_SYMBOL(request_irq); |