From: tip-bot for Keith Busch <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
keith.busch@intel.com, tglx@linutronix.de, rientjes@google.com
Subject: [tip:irq/urgent] genirq: Fix memory leak when calling irq_free_hwirqs()
Date: Sat, 5 Jul 2014 12:45:42 -0700 [thread overview]
Message-ID: <tip-8844aad89ed61545b4db6a3467e1b21ca1c49460@git.kernel.org> (raw)
In-Reply-To: <1404167084-8070-1-git-send-email-keith.busch@intel.com>
Commit-ID: 8844aad89ed61545b4db6a3467e1b21ca1c49460
Gitweb: http://git.kernel.org/tip/8844aad89ed61545b4db6a3467e1b21ca1c49460
Author: Keith Busch <keith.busch@intel.com>
AuthorDate: Mon, 30 Jun 2014 16:24:44 -0600
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 5 Jul 2014 21:42:08 +0200
genirq: Fix memory leak when calling irq_free_hwirqs()
irq_free_hwirqs() always calls irq_free_descs() with a cnt == 0
which makes it a no-op since the interrupt count to free is
decremented in itself.
Fixes: 7b6ef1262549f6afc5c881aaef80beb8fd15f908
Signed-off-by: Keith Busch <keith.busch@intel.com>
Acked-by: David Rientjes <rientjes@google.com>
Link: http://lkml.kernel.org/r/1404167084-8070-1-git-send-email-keith.busch@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/irqdesc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 7339e42..1487a12 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -455,9 +455,9 @@ EXPORT_SYMBOL_GPL(irq_alloc_hwirqs);
*/
void irq_free_hwirqs(unsigned int from, int cnt)
{
- int i;
+ int i, j;
- for (i = from; cnt > 0; i++, cnt--) {
+ for (i = from, j = cnt; j > 0; i++, j--) {
irq_set_status_flags(i, _IRQ_NOREQUEST | _IRQ_NOPROBE);
arch_teardown_hwirq(i);
}
prev parent reply other threads:[~2014-07-05 19:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 22:24 [PATCH] " Keith Busch
2014-07-05 19:45 ` tip-bot for Keith Busch [this message]
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=tip-8844aad89ed61545b4db6a3467e1b21ca1c49460@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rientjes@google.com \
--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
Powered by JetHome