mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-31 19:45:21 +00:00
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 <zhangliguang@linux.alibaba.com> Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
parent
049d919168
commit
3ba52ad55b
1 changed files with 2 additions and 5 deletions
|
@ -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,11 +62,10 @@ 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;
|
||||||
acpi_unregister_gsi(gsi);
|
if (gsi)
|
||||||
|
acpi_unregister_gsi(gsi);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_ARM_SPE_PMU)
|
#if IS_ENABLED(CONFIG_ARM_SPE_PMU)
|
||||||
|
|
Loading…
Add table
Reference in a new issue