diff mbox

ipmi: Fix ioremap error handling in bt-bmc

Message ID 20160921100553.16314-1-joel@jms.id.au
State Accepted
Commit 1a377a79211a08c5c8a05c0b6dee6d5b13ef4107
Headers show

Commit Message

Joel Stanley Sept. 21, 2016, 10:05 a.m. UTC
devm_ioremap_resource returns ERR_PTR so we can't check for NULL.

Signed-off-by: Joel Stanley <joel@jms.id.au>

---
 drivers/char/ipmi/bt-bmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.9.3
diff mbox

Patch

diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 2e880bf0be26..de64bf1f2f4d 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -438,8 +438,8 @@  static int bt_bmc_probe(struct platform_device *pdev)
 	}
 
 	bt_bmc->base = devm_ioremap_resource(&pdev->dev, res);
-	if (!bt_bmc->base)
-		return -ENOMEM;
+	if (IS_ERR(bt_bmc->base))
+		return PTR_ERR(bt_bmc->base);
 
 	mutex_init(&bt_bmc->mutex);
 	init_waitqueue_head(&bt_bmc->queue);