summaryrefslogtreecommitdiffstats
path: root/drivers/misc/pvpanic.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-11-26 09:12:29 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-27 08:26:01 +0100
commit97a64ba77db12e3f33680fc2540453c35b3681f7 (patch)
treebbdc3785f1b7886ebd42722d683910c644b24a7a /drivers/misc/pvpanic.c
parentvmw_balloon: update maintainers list (diff)
downloadlinux-97a64ba77db12e3f33680fc2540453c35b3681f7.tar.xz
linux-97a64ba77db12e3f33680fc2540453c35b3681f7.zip
misc/pvpanic: fix a NULL vs IS_ERR() check
The devm_ioremap_resource() function doesn't return NULL, it returns error pointers. Fixes: 46f934c9a12f ("misc/pvpanic: add support to get pvpanic device info FDT") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/pvpanic.c')
-rw-r--r--drivers/misc/pvpanic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index 01241ec6a5cd..595ac065b401 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -140,8 +140,8 @@ static int pvpanic_mmio_probe(struct platform_device *pdev)
return -EINVAL;
base = devm_ioremap_resource(&pdev->dev, mem);
- if (base == NULL)
- return -EFAULT;
+ if (IS_ERR(base))
+ return PTR_ERR(base);
atomic_notifier_chain_register(&panic_notifier_list,
&pvpanic_panic_nb);