aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rutland <[email protected]>2022-11-08 09:37:25 +0000
committerWill Deacon <[email protected]>2022-11-08 12:42:46 +0000
commita8731264e5ce083eb761e5a6a8273db536743e9e (patch)
treea83dc14a13eb941769f057aad54c973ca60d29fa
parentfe40ffdb7656d1f9c42dd402740765ff8b418b17 (diff)
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: fe40ffdb7656 ("arm_pmu: rework ACPI probing") Signed-off-by: Mark Rutland <[email protected]> Reported-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
-rw-r--r--drivers/perf/arm_pmu_acpi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/perf/arm_pmu_acpi.c b/drivers/perf/arm_pmu_acpi.c
index a085e45b509e..90815ad762eb 100644
--- a/drivers/perf/arm_pmu_acpi.c
+++ b/drivers/perf/arm_pmu_acpi.c
@@ -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;