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 <dan.carpenter@linaro.org> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/04d6ccc3-6d31-4f0f-ab0f-7a88342cc09a@stanley.mountain Signed-off-by: Will Deacon <will@kernel.org>
1 parent 5967a19 commit 2e091a8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)