From: xinghuo.chen@foxmail.com
To: jdelvare@suse.com
Cc: linux@roeck-us.net, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org, jingfelix@hust.edu.cn,
Xinghuo Chen <xinghuo.chen@foxmail.com>
Subject: [PATCH] hwmon: fix a NULL vs IS_ERR() check in xgene_hwmon_probe()
Date: Sat, 1 Mar 2025 22:43:39 -0500 [thread overview]
Message-ID: <tencent_370DBB5BD8EF699EC030ACA74BCB440FFA0A@qq.com> (raw)
From: Xinghuo Chen <xinghuo.chen@foxmail.com>
The devm_memremap() function returns error pointers on error,
it doesn't return NULL.
Signed-off-by: Xinghuo Chen <xinghuo.chen@foxmail.com>
---
drivers/hwmon/xgene-hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
index 1e3bd129a922..4fe30198bae8 100644
--- a/drivers/hwmon/xgene-hwmon.c
+++ b/drivers/hwmon/xgene-hwmon.c
@@ -706,7 +706,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
goto out;
}
- if (!ctx->pcc_comm_addr) {
+ if (IS_ERR(ctx->pcc_comm_addr)) {
dev_err(&pdev->dev,
"Failed to ioremap PCC comm region\n");
rc = -ENOMEM;
--
2.17.1
next reply other threads:[~2025-03-02 4:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-02 3:43 xinghuo.chen [this message]
2025-03-02 16:25 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_370DBB5BD8EF699EC030ACA74BCB440FFA0A@qq.com \
--to=xinghuo.chen@foxmail.com \
--cc=jdelvare@suse.com \
--cc=jingfelix@hust.edu.cn \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®