Commit a8731264 authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon

arm_pmu: acpi: handle allocation failure

One of the failure paths in the arm_pmu ACPI code is missing an early
return, permitting a NULL pointer dereference upon a memory allocation
failure.

Add the missing return.

Fixes: fe40ffdb ("arm_pmu: rework ACPI probing")
Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Reported-by: default avatarWill Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20221108093725.1239563-1-mark.rutland@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent fe40ffdb
......@@ -333,6 +333,7 @@ int arm_pmu_acpi_probe(armpmu_init_fn init_fn)
if (!pmu) {
pr_warn("Unable to allocate PMU for CPU%d\n",
cpu);
return -ENOMEM;
}
cpuid = per_cpu(cpu_data, cpu).reg_midr;
......
Markdown is supported
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