Skip to content

Commit 49776c7

Browse files
Dan Carpenterrafaeljw
authored andcommitted
powercap: RAPL: Fix a NULL vs IS_ERR() bug
The devm_ioremap_resource() function returns error pointers on error, it never returns NULL. Update the check accordingly. Fixes: 9eef7f9 ("powercap: intel_rapl: Introduce RAPL TPMI interface driver") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Zhang Rui <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4658fe8 commit 49776c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/powercap/intel_rapl_tpmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ static int intel_rapl_tpmi_probe(struct auxiliary_device *auxdev,
255255
}
256256

257257
trp->base = devm_ioremap_resource(&auxdev->dev, res);
258-
if (!trp->base) {
259-
ret = -ENOMEM;
258+
if (IS_ERR(trp->base)) {
259+
ret = PTR_ERR(trp->base);
260260
goto err;
261261
}
262262

0 commit comments

Comments
 (0)