arm64: perf: fix memory leak when probing PMU PPIs
authorWill Deacon <will.deacon@arm.com>
Fri, 1 May 2015 16:15:23 +0000 (17:15 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 12 May 2015 15:50:21 +0000 (16:50 +0100)
commit4801ba338acad2e69e905e0c537e8ba2682c4e65
treed2a036987dc6095caa7a884fc04804e52532a0e3
parent1e4df6b7208140f3c49f316d33a409d3a161f350
arm64: perf: fix memory leak when probing PMU PPIs

Commit d795ef9aa831 ("arm64: perf: don't warn about missing
interrupt-affinity property for PPIs") added a check for PPIs so that
we avoid parsing the interrupt-affinity property for these naturally
affine interrupts.

Unfortunately, this check can trigger an early (successful) return and
we will leak the irqs array. This patch fixes the issue by reordering
the code so that the check is performed before any independent
allocation.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/perf_event.c