Skip to content

Commit ad0112f

Browse files
sunke-lpctmarinas
authored andcommitted
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: cf7b610 ("drivers/perf: add DDR Sub-System Driveway PMU driver for Yitian 710 SoC") Signed-off-by: Sun Ke <[email protected]> Acked-by: Will Deacon <[email protected]> Reviewed-by: Shuai Xue <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 171df58 commit ad0112f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/perf/alibaba_uncore_drw_pmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,8 @@ static int ali_drw_pmu_probe(struct platform_device *pdev)
658658

659659
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
660660
drw_pmu->cfg_base = devm_ioremap_resource(&pdev->dev, res);
661-
if (!drw_pmu->cfg_base)
662-
return -ENOMEM;
661+
if (IS_ERR(drw_pmu->cfg_base))
662+
return PTR_ERR(drw_pmu->cfg_base);
663663

664664
name = devm_kasprintf(drw_pmu->dev, GFP_KERNEL, "ali_drw_%llx",
665665
(u64) (res->start >> ALI_DRW_PMU_PA_SHIFT));

0 commit comments

Comments
 (0)