Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check

The devm_ioremap() function does not return error pointers. It returns
NULL.

Fixes: 036a7584bede ("drivers: perf: Add LLC-TAD perf counter support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211217145907.GA16611@kili
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Dan Carpenter and committed by
Will Deacon
2da56881 527a7f52

+1 -1
+1 -1
drivers/perf/marvell_cn10k_tad_pmu.c
··· 312 312 regions[i].base = devm_ioremap(&pdev->dev, 313 313 res->start, 314 314 tad_pmu_page_size); 315 - if (IS_ERR(regions[i].base)) { 315 + if (!regions[i].base) { 316 316 dev_err(&pdev->dev, "TAD%d ioremap fail\n", i); 317 317 return -ENOMEM; 318 318 }