ARM: perf: check that we have a platform device when reserving PMU
commite5a21327644adba32816f74a415114d11c57f2e9
authorWill Deacon <will.deacon@arm.com>
Tue, 22 Nov 2011 18:01:46 +0000 (22 18:01 +0000)
committerWill Deacon <will.deacon@arm.com>
Tue, 22 Nov 2011 18:01:46 +0000 (22 18:01 +0000)
tree81264b2c3ba630e7f5d4f43f9ad99e6268515dad
parentbce34d14428d35d9a06ddc10cd46ecef311764c9
ARM: perf: check that we have a platform device when reserving PMU

Attempting to use a hardware counter on a platform with a supported PMU
but where the platform_device (defining the interrupts) has not been
registered results in a NULL pointer dereference.

This patch fixes the problem by checking that we actually have a platform
device registered before attempting to grab the interrupts.

Reported-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/kernel/perf_event.c