Commit 3ba52ad5 authored by luanshi's avatar luanshi Committed by Will Deacon

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: default avatarLiguang Zhang <zhangliguang@linux.alibaba.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 049d9191
...@@ -24,8 +24,6 @@ static int arm_pmu_acpi_register_irq(int cpu) ...@@ -24,8 +24,6 @@ static int arm_pmu_acpi_register_irq(int cpu)
int gsi, trigger; int gsi, trigger;
gicc = acpi_cpu_get_madt_gicc(cpu); gicc = acpi_cpu_get_madt_gicc(cpu);
if (WARN_ON(!gicc))
return -EINVAL;
gsi = gicc->performance_interrupt; gsi = gicc->performance_interrupt;
...@@ -64,10 +62,9 @@ static void arm_pmu_acpi_unregister_irq(int cpu) ...@@ -64,10 +62,9 @@ static void arm_pmu_acpi_unregister_irq(int cpu)
int gsi; int gsi;
gicc = acpi_cpu_get_madt_gicc(cpu); gicc = acpi_cpu_get_madt_gicc(cpu);
if (!gicc)
return;
gsi = gicc->performance_interrupt; gsi = gicc->performance_interrupt;
if (gsi)
acpi_unregister_gsi(gsi); acpi_unregister_gsi(gsi);
} }
......
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