Commit 2e091a80 authored by Dan Carpenter's avatar Dan Carpenter Committed by Will Deacon

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: 4d5a7680 ("perf: Add driver for Arm NI-700 interconnect PMU")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/04d6ccc3-6d31-4f0f-ab0f-7a88342cc09a@stanley.mountainSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 5967a19f
......@@ -603,8 +603,8 @@ static int arm_ni_probe(struct platform_device *pdev)
*/
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (IS_ERR(base))
return PTR_ERR(base);
if (!base)
return -ENOMEM;
arm_ni_probe_domain(base, &cfg);
if (cfg.type != NI_GLOBAL)
......
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