Skip to contentSkip to conversation

arm_pmu: acpi: handle allocation failure

PATCH Applied Mark Rutland 2 participants 2 messages Nov 8, 2022 Arm PMU profiling and debugging

lore
Share & tools
lore

Mark Rutland

author maintainer
#0 lore raw

PATCH 1/1 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 fe40ffdb7656d1f9 ("arm_pmu: rework ACPI probing")
---
 drivers/perf/arm_pmu_acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/arm_pmu_acpi.c +1 -0
index a085e45b509e1..90815ad762ebc 100644
@@ -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;
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#1 lore raw
Quoted 8 lines · Mark Rutland

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.

[...]

Applied to arm64 (for-next/acpi), thanks!

[1/1] arm_pmu: acpi: handle allocation failure

      https://git.kernel.org/arm64/c/a8731264e5ce

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel