Skip to contentSkip to conversation

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

PATCH New Gregory CLEMENT 2 participants 2 messages Jan 20, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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.

---
Jason,

As this is a fix on a fix which should be ported to the stable branch, I don't know how to handle the cc:stable flag

 arch/arm/mach-mvebu/mvebu-soc-id.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-mvebu/mvebu-soc-id.c +1 -1
index fe4fc1cbdfaf..f3b325f6cbd4 100644
@@ -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;
Signature · 1 line
1.8.1.2
Applied
#1 lore raw

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

Quoted 5 lines · Gregory CLEMENT

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.

Quoted 7 lines

---
Jason,

As this is a fix on a fix which should be ported to the stable branch, I don't know how to handle the cc:stable flag

No problem, I added it.

Quoted 2 lines
 arch/arm/mach-mvebu/mvebu-soc-id.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to mvebu/fixes.

thx,

Jason.