drivers/perf: arm_pmu: Fix leak in error path
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 27 Aug 2016 16:19:49 +0000 (16:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2016 13:23:41 +0000 (15:23 +0200)
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 <stefan.wahren@i2se.com>
Fixes: fa8ad7889d83 ("arm: perf: factor arm_pmu core out to drivers")
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/perf/arm_pmu.c

index be3755c973e96d4c6ee48f0459c751ba6d225665..8af1f900ea6587698ddd2000ab522f81139296c1 100644 (file)
@@ -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;
                        }