ipmi: Fix ioremap error handling in bt-bmc
authorJoel Stanley <joel@jms.id.au>
Wed, 21 Sep 2016 10:05:53 +0000 (19:35 +0930)
committerCorey Minyard <cminyard@mvista.com>
Fri, 30 Sep 2016 00:05:06 +0000 (19:05 -0500)
devm_ioremap_resource returns ERR_PTR so we can't check for NULL.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Acked-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/bt-bmc.c

index 2e880bf0be26abe6c555e4ee6d62ea042745aaa7..de64bf1f2f4d4181ef31c83c8f48e7b8911f2c08 100644 (file)
@@ -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);