Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467451 > unrolled thread

[PATCH] genirq: fix potential memleak when failing to get irq pm

Started byShawn Lin <shawn.lin@rock-chips.com>
First post2016-08-22 10:30 +0200
Last post2016-08-22 10:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] genirq: fix potential memleak when failing to get irq pm Shawn Lin <shawn.lin@rock-chips.com> - 2016-08-22 10:30 +0200

#1467451 — [PATCH] genirq: fix potential memleak when failing to get irq pm

FromShawn Lin <shawn.lin@rock-chips.com>
Date2016-08-22 10:30 +0200
Subject[PATCH] genirq: fix potential memleak when failing to get irq pm
Message-ID<s8SMh-3Ra-21@gated-at.bofh.it>
Obviously we should free action here if irq_chip_pm_get
failed.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.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 73a2b78..844d95e 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1681,8 +1681,10 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
 	action->dev_id = dev_id;
 
 	retval = irq_chip_pm_get(&desc->irq_data);
-	if (retval < 0)
+	if (retval < 0) {
+		kfree(action);
 		return retval;
+	}
 
 	chip_bus_lock(desc);
 	retval = __setup_irq(irq, desc, action);
-- 
2.3.7

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web