summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Zhe <yuzhe@nfschina.com>2022-08-25 09:18:44 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-20 12:39:45 +0200
commitd4441b810bd893e4c112a760fca809fe5c073b45 (patch)
treec9a02e1561380a766aa3d4ff7f4fc7ee734e591e
parent55032fb14d4a3db6ba6e4a0725c985becc2a5456 (diff)
perf/arm_pmu_platform: fix tests for platform_get_irq() failure
[ Upstream commit 6bb0d64c100091e131cd16710b62fda3319cd0af ] The platform_get_irq() returns negative error codes. It can't actually return zero. Signed-off-by: Yu Zhe <yuzhe@nfschina.com> Link: https://lore.kernel.org/r/20220825011844.8536-1-yuzhe@nfschina.com Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/perf/arm_pmu_platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
index 513de1f54e2d..933b96e243b8 100644
--- a/drivers/perf/arm_pmu_platform.c
+++ b/drivers/perf/arm_pmu_platform.c
@@ -117,7 +117,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
if (num_irqs == 1) {
int irq = platform_get_irq(pdev, 0);
- if (irq && irq_is_percpu_devid(irq))
+ if ((irq > 0) && irq_is_percpu_devid(irq))
return pmu_parse_percpu_irq(pmu, irq);
}