[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211221112252.306558-1-yangyingliang@huawei.com>
Date: Tue, 21 Dec 2021 19:22:52 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
CC: <will@...nel.org>, <bbudiredla@...vell.com>
Subject: [PATCH -next] perf/marvell_cn10k_tad_pmu: Fix return value check in tad_pmu_probe()
In case of error, the function devm_ioremap() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Fixes: 036a7584bede ("drivers: perf: Add LLC-TAD perf counter support")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
drivers/perf/marvell_cn10k_tad_pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c
index 250dd4c52d70..7f4d292658e3 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;
}
--
2.25.1
Powered by blists - more mailing lists