Commit bcd9ec70 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[PATCH] ppc64: Fix default command line

The ppc64 kernel can be built with a default command line (CONFIG_CMDLINE)
for cases where none is provided by the firmware.

However, some OF implementation always pass a "bootargs" property that only
contains the "0" terminating byte of a C string which caused us to think
there was a command line, and not use the built-in one. This patch fixes it.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 30807263
......@@ -823,7 +823,7 @@ void __init unflatten_device_tree(void)
strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE));
}
#ifdef CONFIG_CMDLINE
if (l == 0) /* dbl check */
if (l == 0 || (l == 1 && (*p) == 0))
strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
#endif /* CONFIG_CMDLINE */
......
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