Commit 499a4584 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Linus Torvalds

init: fix possible format string bug

Use constant format string in case message changes.
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 128e3f45
...@@ -583,7 +583,7 @@ static int __init populate_rootfs(void) ...@@ -583,7 +583,7 @@ static int __init populate_rootfs(void)
{ {
char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
if (err) if (err)
panic(err); /* Failed to decompress INTERNAL initramfs */ panic("%s", err); /* Failed to decompress INTERNAL initramfs */
if (initrd_start) { if (initrd_start) {
#ifdef CONFIG_BLK_DEV_RAM #ifdef CONFIG_BLK_DEV_RAM
int fd; int fd;
......
...@@ -278,7 +278,7 @@ static int __init unknown_bootoption(char *param, char *val, const char *unused) ...@@ -278,7 +278,7 @@ static int __init unknown_bootoption(char *param, char *val, const char *unused)
unsigned int i; unsigned int i;
for (i = 0; envp_init[i]; i++) { for (i = 0; envp_init[i]; i++) {
if (i == MAX_INIT_ENVS) { if (i == MAX_INIT_ENVS) {
panic_later = "Too many boot env vars at `%s'"; panic_later = "env";
panic_param = param; panic_param = param;
} }
if (!strncmp(param, envp_init[i], val - param)) if (!strncmp(param, envp_init[i], val - param))
...@@ -290,7 +290,7 @@ static int __init unknown_bootoption(char *param, char *val, const char *unused) ...@@ -290,7 +290,7 @@ static int __init unknown_bootoption(char *param, char *val, const char *unused)
unsigned int i; unsigned int i;
for (i = 0; argv_init[i]; i++) { for (i = 0; argv_init[i]; i++) {
if (i == MAX_INIT_ARGS) { if (i == MAX_INIT_ARGS) {
panic_later = "Too many boot init vars at `%s'"; panic_later = "init";
panic_param = param; panic_param = param;
} }
} }
...@@ -582,7 +582,8 @@ asmlinkage void __init start_kernel(void) ...@@ -582,7 +582,8 @@ asmlinkage void __init start_kernel(void)
*/ */
console_init(); console_init();
if (panic_later) if (panic_later)
panic(panic_later, panic_param); panic("Too many boot %s vars at `%s'", panic_later,
panic_param);
lockdep_info(); lockdep_info();
......
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