Skip to content

Commit

Permalink
powercap: RAPL: Fix a NULL vs IS_ERR() bug
Browse files Browse the repository at this point in the history
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 <dan.carpenter@linaro.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Dan Carpenter authored and Rafael J. Wysocki committed Jun 12, 2023
1 parent 4658fe8 commit 49776c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/powercap/intel_rapl_tpmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 49776c7

Please sign in to comment.