From: Dan Carpenter <dan.carpenter@linaro.org>
To: Zhang Rui <rui.zhang@intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] powercap: intel_rapl: Fix a NULL vs IS_ERR() bug
Date: Tue, 6 Jun 2023 11:22:42 +0300 [thread overview]
Message-ID: <ZH7s0qNJ8a/KHjvQ@moroto> (raw)
The devm_ioremap_resource() function returns error pointers on error,
it never returns NULL. Update the check accordingly.
Fixes: 9eef7f9da928 ("powercap: intel_rapl: Introduce RAPL TPMI interface driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/powercap/intel_rapl_tpmi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/powercap/intel_rapl_tpmi.c b/drivers/powercap/intel_rapl_tpmi.c
index c016127b3497..4f4f13ded225 100644
--- a/drivers/powercap/intel_rapl_tpmi.c
+++ b/drivers/powercap/intel_rapl_tpmi.c
@@ -255,8 +255,8 @@ static int intel_rapl_tpmi_probe(struct auxiliary_device *auxdev,
}
trp->base = devm_ioremap_resource(&auxdev->dev, res);
- if (!trp->base) {
- ret = -ENOMEM;
+ if (IS_ERR(trp->base)) {
+ ret = PTR_ERR(trp->base);
goto err;
}
--
2.39.2
next reply other threads:[~2023-06-06 8:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 8:22 Dan Carpenter [this message]
2023-06-06 8:56 ` [PATCH] powercap: intel_rapl: Fix a NULL vs IS_ERR() bug Zhang, Rui
2023-06-12 17:52 ` Rafael J. Wysocki
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=ZH7s0qNJ8a/KHjvQ@moroto \
--to=dan.carpenter@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
/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