arm_pmu: acpi: handle allocation failure
Mark Rutland
maintainerPATCH 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")
Signed-off-by Mark Rutland <[email protected]>
Reported-by Will Deacon <[email protected]>
--- drivers/perf/arm_pmu_acpi.c | 1 + 1 file changed, 1 insertion(+)
drivers/perf/arm_pmu_acpi.c +1 -0
@@ -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
Quoted 8 lines · Mark Rutland
One of the failure paths in the
arm_pmuACPI 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