Commit 49776c71 authored by Dan Carpenter's avatar Dan Carpenter Committed by Rafael J. Wysocki

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: 9eef7f9d ("powercap: intel_rapl: Introduce RAPL TPMI interface driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 4658fe81
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment