瀏覽代碼

[SPARC]: Fix serial console node string creation.

The string setting code depends upon the original value of the
"skip" variable, not the one that gets modified by the node
traversal loop.

Based upon a patch by Mark Fortescue.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 18 年之前
父節點
當前提交
f623f388e4
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      arch/sparc/kernel/prom.c

+ 3 - 2
arch/sparc/kernel/prom.c

@@ -415,7 +415,7 @@ static void __init of_console_init(void)
 	unsigned long flags;
 	const char *type;
 	phandle node;
-	int skip, fd;
+	int skip, tmp, fd;
 
 	of_console_path = prom_early_alloc(256);
 
@@ -442,8 +442,9 @@ static void __init of_console_init(void)
 			prom_halt();
 		}
 
+		tmp = skip;
 		for_each_node_by_type(dp, type) {
-			if (!skip--)
+			if (!tmp--)
 				break;
 		}
 		if (!dp) {