Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

genirq: Fix potential memleak when failing to get irq pm

Obviously we should free action here if irq_chip_pm_get failed.

Fixes: be45beb2df69: "genirq: Add runtime power management support for IRQ chips"
Signed-off-by: Shawn 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.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Shawn Lin and committed by
Thomas Gleixner
4396f46c d16c995f

+6 -2
+6 -2
kernel/irq/manage.c
··· 1681 1681 action->dev_id = dev_id; 1682 1682 1683 1683 retval = irq_chip_pm_get(&desc->irq_data); 1684 - if (retval < 0) 1684 + if (retval < 0) { 1685 + kfree(action); 1685 1686 return retval; 1687 + } 1686 1688 1687 1689 chip_bus_lock(desc); 1688 1690 retval = __setup_irq(irq, desc, action); ··· 1987 1985 action->percpu_dev_id = dev_id; 1988 1986 1989 1987 retval = irq_chip_pm_get(&desc->irq_data); 1990 - if (retval < 0) 1988 + if (retval < 0) { 1989 + kfree(action); 1991 1990 return retval; 1991 + } 1992 1992 1993 1993 chip_bus_lock(desc); 1994 1994 retval = __setup_irq(irq, desc, action);