From: Dan Carpenter Date: Fri, 17 Dec 2021 14:59:08 +0000 (+0300) Subject: drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check X-Git-Tag: baikal/mips/sdk6.1~6758^2~2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=20559b995311a64d41dc928857a2dcad837fd088;p=kernel.git drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check The devm_ioremap() function does not return error pointers. It returns NULL. Fixes: 398d505b88ea ("drivers: perf: Add LLC-TAD perf counter support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211217145907.GA16611@kili Signed-off-by: Will Deacon --- diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c index 250dd4c52d705..7f4d292658e32 100644 --- a/drivers/perf/marvell_cn10k_tad_pmu.c +++ b/drivers/perf/marvell_cn10k_tad_pmu.c @@ -312,7 +312,7 @@ static int tad_pmu_probe(struct platform_device *pdev) regions[i].base = devm_ioremap(&pdev->dev, res->start, tad_pmu_page_size); - if (IS_ERR(regions[i].base)) { + if (!regions[i].base) { dev_err(&pdev->dev, "TAD%d ioremap fail\n", i); return -ENOMEM; }