]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0ac8cd5fe430faf51172ad444084fef4de4459fd
treed2a036987dc6095caa7a884fc04804e52532a0e3
parent9038c4b1d71d67a7f54f8a736c566f5003cd56ab
arm64: perf: fix memory leak when probing PMU PPIs

Commit ddc6e5d49d2b ("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