提交 4396f46c 编写于 作者: S Shawn Lin 提交者: Thomas Gleixner

genirq: Fix potential memleak when failing to get irq pm

Obviously we should free action here if irq_chip_pm_get failed.

Fixes: be45beb2: "genirq: Add runtime power management support for IRQ chips"
Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/1471854112-13006-1-git-send-email-shawn.lin@rock-chips.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 d16c995f
...@@ -1681,8 +1681,10 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler, ...@@ -1681,8 +1681,10 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
action->dev_id = dev_id; action->dev_id = dev_id;
retval = irq_chip_pm_get(&desc->irq_data); retval = irq_chip_pm_get(&desc->irq_data);
if (retval < 0) if (retval < 0) {
kfree(action);
return retval; return retval;
}
chip_bus_lock(desc); chip_bus_lock(desc);
retval = __setup_irq(irq, desc, action); retval = __setup_irq(irq, desc, action);
...@@ -1985,8 +1987,10 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler, ...@@ -1985,8 +1987,10 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
action->percpu_dev_id = dev_id; action->percpu_dev_id = dev_id;
retval = irq_chip_pm_get(&desc->irq_data); retval = irq_chip_pm_get(&desc->irq_data);
if (retval < 0) if (retval < 0) {
kfree(action);
return retval; return retval;
}
chip_bus_lock(desc); chip_bus_lock(desc);
retval = __setup_irq(irq, desc, action); retval = __setup_irq(irq, desc, action);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册