Skip to content

Commit

Permalink
[SPARC]: Fix serial console node string creation.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Jul 30, 2007
1 parent 8163904 commit f623f38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/sparc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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) {
Expand Down

0 comments on commit f623f38

Please sign in to comment.