]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 7185/1: perf: don't assign platform_device on unsupported CPUs
authorWill Deacon <will.deacon@arm.com>
Fri, 2 Dec 2011 17:16:01 +0000 (18:16 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 6 Dec 2011 12:48:01 +0000 (12:48 +0000)
commit4c42414a3755227b2719c4eae1d0021728dd91ab
treef24116c9e5804abc2bd2ce95d09773b7a578ee69
parenta90f630a3f2716399fb431434921c2c5631b370f
ARM: 7185/1: perf: don't assign platform_device on unsupported CPUs

In the unlikely case that a platform registers a PMU platform_device
when running on a CPU that is unsupported by perf, we will encounter a
NULL dereference when trying to assign the platform_device to the
cpu_pmu structure.

This patch checks that the CPU is supported by perf before assigning
the platform_device.

Reported-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/perf_event.c