]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: perf: handle armpmu_register failing
authorMark Rutland <Mark.Rutland@arm.com>
Fri, 18 Jan 2013 13:42:58 +0000 (13:42 +0000)
committerWill Deacon <will.deacon@arm.com>
Fri, 18 Jan 2013 13:46:09 +0000 (13:46 +0000)
commit7991d839c691414126b9b9e8ceaf59736d8e4971
tree1a525b2b01ed5e18a1d2a6f444b141b09c7d8292
parent7e5d8153b28134bc9e5d0d03e1b58cdb72298696
ARM: perf: handle armpmu_register failing

Currently perf_pmu_register may fail for several reasons (e.g. being
unable to allocate memory for the struct device it associates with each
PMU), and while any error is propagated by armpmu_register, it is
ignored by cpu_pmu_device_probe and not propagated to the caller.  This
also results in a leak of a struct arm_pmu.

This patch adds cleanup if armpmu_register fails, and updates the info
messages to better differentiate this type of failure from a failure to
probe the PMU type from the hardware or dt.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/perf_event_cpu.c