From: Gregory CLEMENT Date: Mon, 20 Jan 2014 14:59:50 +0000 (+0100) Subject: ARM: mvebu: Fix kernel hang in mvebu_soc_id_init() when of_iomap failed X-Git-Tag: v3.12.11~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=020043ee82cf6f8b61b76cb90af73818f66e9f60;p=kernel%2Fkernel-generic.git ARM: mvebu: Fix kernel hang in mvebu_soc_id_init() when of_iomap failed commit dc4910d9e93f8cc56b190dd8fc9e789135978216 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: Gregory CLEMENT Reported-by: Ezequiel Garcia Fixes: 930ab3d403ae (i2c: mv64xxx: Add I2C Transaction Generator support) Signed-off-by: Jason Cooper Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c index fe4fc1c..f3b325f 100644 --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c @@ -88,7 +88,7 @@ static int __init mvebu_soc_id_init(void) } pci_base = of_iomap(child, 0); - if (IS_ERR(pci_base)) { + if (pci_base == NULL) { pr_err("cannot map registers\n"); ret = -ENOMEM; goto res_ioremap;