]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/perf: arm_pmu: avoid NULL dereference when not using devicetree
authorWill Deacon <will.deacon@arm.com>
Mon, 21 Mar 2016 11:07:15 +0000 (11:07 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 21 Mar 2016 11:36:17 +0000 (11:36 +0000)
commitf6b191d5d64d91fe29673b567c5f28dc1afc7ad1
tree0720017fa61ca0f3e6a152d30d82b4c2a1914fb5
parent4e56a3a9346186244b216ecc8eeb9580fc80dedd
drivers/perf: arm_pmu: avoid NULL dereference when not using devicetree

Commit b73c1e7aa21e ("drivers/perf: arm_pmu: make info messages more
verbose") breaks booting on systems where the PMU is probed without
devicetree (e.g by inspecting the MIDR of the current CPU). In this case,
pdev->dev.of_node is NULL and we shouldn't try to access its ->fullname
field when printing probe error messages.

This patch fixes the probing code to use of_node_full_name, which safely
handles NULL nodes and removes the "Error %i" part of the string, since
it's not terribly useful.

Reported-by: Guenter Roeck <private@roeck-us.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/perf/arm_pmu.c