From: Heiner Kallweit <hkallweit1@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] genirq: fix error path in __setup_irq
Date: Sun, 11 Jun 2017 00:38:36 +0200 [thread overview]
Message-ID: <655538f5-cb20-a892-ff15-fbd2dd1fa4ec@gmail.com> (raw)
If __irq_set_trigger() fails irq_request_resources() was successfully
called before. Therefore we should release all potentially claimed
resources in the error path.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
kernel/irq/manage.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 49c37f1e..4c34696c 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1318,8 +1318,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
ret = __irq_set_trigger(desc,
new->flags & IRQF_TRIGGER_MASK);
- if (ret)
+ if (ret) {
+ irq_release_resources(desc);
goto out_mask;
+ }
}
desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \
--
2.13.1
next reply other threads:[~2017-06-10 22:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-10 22:38 Heiner Kallweit [this message]
2017-06-12 22:43 ` [tip:irq/urgent] genirq: Release resources in __setup_irq() error path tip-bot for Heiner Kallweit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=655538f5-cb20-a892-ff15-fbd2dd1fa4ec@gmail.com \
--to=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®