Skip to content

Commit 2e091a8

Browse files
Dan Carpenterwilldeacon
authored andcommitted
perf: arm-ni: Fix an NULL vs IS_ERR() bug
The devm_ioremap() function never returns error pointers, it returns a NULL pointer if there is an error. Fixes: 4d5a768 ("perf: Add driver for Arm NI-700 interconnect PMU") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 5967a19 commit 2e091a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/perf/arm-ni.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,8 @@ static int arm_ni_probe(struct platform_device *pdev)
603603
*/
604604
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
605605
base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
606-
if (IS_ERR(base))
607-
return PTR_ERR(base);
606+
if (!base)
607+
return -ENOMEM;
608608

609609
arm_ni_probe_domain(base, &cfg);
610610
if (cfg.type != NI_GLOBAL)

0 commit comments

Comments
 (0)