Commit ad0112f2 authored by Sun Ke's avatar Sun Ke Committed by Catalin Marinas

drivers/perf: fix return value check in ali_drw_pmu_probe()

In case of error, devm_ioremap_resource() returns ERR_PTR(),
and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Fixes: cf7b6107 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC")
Signed-off-by: default avatarSun Ke <sunke32@huawei.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Reviewed-by: default avatarShuai Xue <xueshuai@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220924032127.313156-1-sunke32@huawei.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 171df580
......@@ -658,8 +658,8 @@ static int ali_drw_pmu_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drw_pmu->cfg_base = devm_ioremap_resource(&pdev->dev, res);
if (!drw_pmu->cfg_base)
return -ENOMEM;
if (IS_ERR(drw_pmu->cfg_base))
return PTR_ERR(drw_pmu->cfg_base);
name = devm_kasprintf(drw_pmu->dev, GFP_KERNEL, "ali_drw_%llx",
(u64) (res->start >> ALI_DRW_PMU_PA_SHIFT));
......
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