diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-06-06 11:22:42 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-06-12 20:51:21 +0300 |
commit | 49776c712eb6ded12fcbb8cc915a498dbfb47311 (patch) | |
tree | 3f929025c93859e6a3d430451ac64c78ef6062a8 | |
parent | 4658fe81b3f8afe8adf37734ec5fe595d90415c6 (diff) | |
download | linux-49776c712eb6ded12fcbb8cc915a498dbfb47311.tar.xz |
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: 9eef7f9da928 ("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>
-rw-r--r-- | drivers/powercap/intel_rapl_tpmi.c | 4 |
1 files 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; } |