Skip to content
Commit 754a58db authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Will Deacon
Browse files

perf: arm_spe: handle devm_kasprintf() failure



devm_kasprintf() may return NULL on failure of internal allocation
thus the assignment to 'name' is not safe if unchecked. If NULL
is passed in for name then perf_pmu_register() would not fail
but rather silently jump to skip_type which is not the intent
here. As perf_pmu_register() may also return -ENOMEM returning
-ENOMEM in the (unlikely) failure case of devm_kasprintf() should
be fine here as well.

Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Fixes: d5d9696b

 ("drivers/perf: Add support for ARMv8.2 Statistical Profiling Extension")
Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
[will: reworded error message]
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent cbb72a3c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment