Skip to content

Commit

Permalink
perf/arm_pmu_platform: fix tests for platform_get_irq() failure
Browse files Browse the repository at this point in the history
[ Upstream commit 6bb0d64 ]

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>
  • Loading branch information
yuzhenfschina authored and gregkh committed Sep 20, 2022
1 parent 3d513eb commit 719b202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/perf/arm_pmu_platform.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit 719b202

Please sign in to comment.