Commit 10fce7eb authored by Xinghuo Chen's avatar Xinghuo Chen Committed by Guenter Roeck
Browse files

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: c7cefce0 ("hwmon: (xgene) access mailbox as RAM")
Signed-off-by: default avatarXinghuo Chen <xinghuo.chen@foxmail.com>
Link: https://lore.kernel.org/r/tencent_9AD8E7683EC29CAC97496B44F3F865BA070A@qq.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent e278d5e8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -706,7 +706,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
			goto out;
		}

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