Skip to content

Commit 10fce7e

Browse files
Xinghuo Chengroeck
authored andcommitted
hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe()
The devm_memremap() function returns error pointers on error, it doesn't return NULL. Fixes: c7cefce ("hwmon: (xgene) access mailbox as RAM") Signed-off-by: Xinghuo Chen <xinghuo.chen@foxmail.com> Link: https://lore.kernel.org/r/tencent_9AD8E7683EC29CAC97496B44F3F865BA070A@qq.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent e278d5e commit 10fce7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hwmon/xgene-hwmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
706706
goto out;
707707
}
708708

709-
if (!ctx->pcc_comm_addr) {
709+
if (IS_ERR_OR_NULL(ctx->pcc_comm_addr)) {
710710
dev_err(&pdev->dev,
711711
"Failed to ioremap PCC comm region\n");
712712
rc = -ENOMEM;

0 commit comments

Comments
 (0)