Commit 020043ee authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Greg Kroah-Hartman

ARM: mvebu: Fix kernel hang in mvebu_soc_id_init() when of_iomap failed

commit dc4910d9 upstream.

When pci_base is accessed whereas it has not been properly mapped by
of_iomap() the kernel hang. The check of this pointer made an improper
use of IS_ERR() instead of comparing to NULL. This patch fix this
issue.
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
Reported-by: default avatarEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Fixes: 930ab3d4 (i2c: mv64xxx: Add I2C Transaction Generator support)
Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd4042ce
...@@ -88,7 +88,7 @@ static int __init mvebu_soc_id_init(void) ...@@ -88,7 +88,7 @@ static int __init mvebu_soc_id_init(void)
} }
pci_base = of_iomap(child, 0); pci_base = of_iomap(child, 0);
if (IS_ERR(pci_base)) { if (pci_base == NULL) {
pr_err("cannot map registers\n"); pr_err("cannot map registers\n");
ret = -ENOMEM; ret = -ENOMEM;
goto res_ioremap; goto res_ioremap;
......
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