Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] powercap: intel_rapl: Fix a NULL vs IS_ERR() bug
@ 2023-06-06  8:22 Dan Carpenter
  2023-06-06  8:56 ` Zhang, Rui
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2023-06-06  8:22 UTC (permalink / raw)
  To: Zhang Rui; +Cc: Rafael J. Wysocki, linux-pm, kernel-janitors

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-12 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-06  8:22 [PATCH] powercap: intel_rapl: Fix a NULL vs IS_ERR() bug Dan Carpenter
2023-06-06  8:56 ` Zhang, Rui
2023-06-12 17:52   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox