Skip to content

Commit 3ba52ad

Browse files
luanshi0212willdeacon
authored andcommitted
drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer
Fix bogus NULL checks on the return value of acpi_cpu_get_madt_gicc() by checking for a 0 'gicc->performance_interrupt' value instead. Signed-off-by: Liguang Zhang <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 049d919 commit 3ba52ad

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/perf/arm_pmu_acpi.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ static int arm_pmu_acpi_register_irq(int cpu)
2424
int gsi, trigger;
2525

2626
gicc = acpi_cpu_get_madt_gicc(cpu);
27-
if (WARN_ON(!gicc))
28-
return -EINVAL;
2927

3028
gsi = gicc->performance_interrupt;
3129

@@ -64,11 +62,10 @@ static void arm_pmu_acpi_unregister_irq(int cpu)
6462
int gsi;
6563

6664
gicc = acpi_cpu_get_madt_gicc(cpu);
67-
if (!gicc)
68-
return;
6965

7066
gsi = gicc->performance_interrupt;
71-
acpi_unregister_gsi(gsi);
67+
if (gsi)
68+
acpi_unregister_gsi(gsi);
7269
}
7370

7471
#if IS_ENABLED(CONFIG_ARM_SPE_PMU)

0 commit comments

Comments
 (0)