* [PATCH] misc/pvpanic: fix a NULL vs IS_ERR() check
@ 2018-11-26 8:12 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-11-26 8:12 UTC (permalink / raw)
To: Arnd Bergmann, Peng Hao; +Cc: Greg Kroah-Hartman, linux-kernel, kernel-janitors
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>
---
drivers/misc/pvpanic.c | 4 ++--
1 file 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);
--
2.11.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-26 8:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-26 8:12 [PATCH] misc/pvpanic: fix a NULL vs IS_ERR() check Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).