diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2017-06-11 01:38:36 +0300 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2017-06-26 05:02:22 +0300 |
commit | 61e04a644bd8f083e8c6354dae187a672b0e8f90 (patch) | |
tree | 09bb6e3bb759443dccfc25e743b90a896a1a104c | |
parent | ec8376b633c9cef45790bf5b2cee7fe6d319748a (diff) | |
download | linux-61e04a644bd8f083e8c6354dae187a672b0e8f90.tar.xz |
genirq: Release resources in __setup_irq() error path
[ Upstream commit fa07ab72cbb0d843429e61bf179308aed6cbe0dd ]
In case __irq_set_trigger() fails the resources requested via
irq_request_resources() are not released.
Add the missing release call into the error handling path.
Fixes: c1bacbae8192 ("genirq: Provide irq_request/release_resources chip callbacks")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/655538f5-cb20-a892-ff15-fbd2dd1fa4ec@gmail.com
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r-- | kernel/irq/manage.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index e68932bb308e..f4b1f0a1dba5 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1193,8 +1193,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) ret = __irq_set_trigger(desc, irq, new->flags & IRQF_TRIGGER_MASK); - if (ret) + if (ret) { + irq_release_resources(desc); goto out_mask; + } } desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \ |