diff options
author | Keith Busch <keith.busch@intel.com> | 2014-06-30 18:24:44 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-07-05 15:42:08 -0400 |
commit | 8844aad89ed61545b4db6a3467e1b21ca1c49460 (patch) | |
tree | 8517cee7ee48747ed7448eb14bfe81634695cca4 /kernel | |
parent | 4f4366033945419b0c52118c29d3057d7c558765 (diff) |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/irq/irqdesc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 7339e42a85ab..1487a123db5c 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
@@ -455,9 +455,9 @@ EXPORT_SYMBOL_GPL(irq_alloc_hwirqs); | |||
455 | */ | 455 | */ |
456 | void irq_free_hwirqs(unsigned int from, int cnt) | 456 | void irq_free_hwirqs(unsigned int from, int cnt) |
457 | { | 457 | { |
458 | int i; | 458 | int i, j; |
459 | 459 | ||
460 | for (i = from; cnt > 0; i++, cnt--) { | 460 | for (i = from, j = cnt; j > 0; i++, j--) { |
461 | irq_set_status_flags(i, _IRQ_NOREQUEST | _IRQ_NOPROBE); | 461 | irq_set_status_flags(i, _IRQ_NOREQUEST | _IRQ_NOPROBE); |
462 | arch_teardown_hwirq(i); | 462 | arch_teardown_hwirq(i); |
463 | } | 463 | } |