Commit b3e9f82b authored by luanshi's avatar luanshi Committed by Greg Kroah-Hartman

drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer

[ Upstream commit 3ba52ad5 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a832f5e0
......@@ -27,8 +27,6 @@ static int arm_pmu_acpi_register_irq(int cpu)
int gsi, trigger;
gicc = acpi_cpu_get_madt_gicc(cpu);
if (WARN_ON(!gicc))
return -EINVAL;
gsi = gicc->performance_interrupt;
......@@ -67,11 +65,10 @@ static void arm_pmu_acpi_unregister_irq(int cpu)
int gsi;
gicc = acpi_cpu_get_madt_gicc(cpu);
if (!gicc)
return;
gsi = gicc->performance_interrupt;
acpi_unregister_gsi(gsi);
if (gsi)
acpi_unregister_gsi(gsi);
}
static int arm_pmu_acpi_parse_irqs(void)
......
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