From: Stefan Wahren Date: Sat, 27 Aug 2016 16:19:49 +0000 (+0000) Subject: drivers/perf: arm_pmu: Fix leak in error path X-Git-Tag: firefly_0821_release~176^2~4^2~26^2~98 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2b86bd6a16074544a477410cd5d390b9b3e72958;p=firefly-linux-kernel-4.4.55.git drivers/perf: arm_pmu: Fix leak in error path commit 753246840d012ae34ea80a1d40bc1546c62fb957 upstream. In case of a IRQ type mismatch in of_pmu_irq_cfg() the device node for interrupt affinity isn't freed. So fix this issue by calling of_node_put(). Signed-off-by: Stefan Wahren Fixes: fa8ad7889d83 ("arm: perf: factor arm_pmu core out to drivers") Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index be3755c973e9..8af1f900ea65 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -815,6 +815,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu) if (i > 0 && spi != using_spi) { pr_err("PPI/SPI IRQ type mismatch for %s!\n", dn->name); + of_node_put(dn); kfree(irqs); return -EINVAL; }