aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>2014-01-23 18:54:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:58 -0500
commit499a4584d7f817d43d09ccfc6bb26315eeaab6bc (patch)
tree571e45ed5894c452402fef44ac4f03bc85d08f81 /init
parent128e3f4541ec844c90a99320bf7d2909da4ef80b (diff)
init: fix possible format string bug
Use constant format string in case message changes. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/initramfs.c2
-rw-r--r--init/main.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index a67ef9dbda9d..93b61396756b 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -583,7 +583,7 @@ static int __init populate_rootfs(void)
583{ 583{
584 char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); 584 char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
585 if (err) 585 if (err)
586 panic(err); /* Failed to decompress INTERNAL initramfs */ 586 panic("%s", err); /* Failed to decompress INTERNAL initramfs */
587 if (initrd_start) { 587 if (initrd_start) {
588#ifdef CONFIG_BLK_DEV_RAM 588#ifdef CONFIG_BLK_DEV_RAM
589 int fd; 589 int fd;
diff --git a/init/main.c b/init/main.c
index 98e3537fa71d..f333385d9a4f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -278,7 +278,7 @@ static int __init unknown_bootoption(char *param, char *val, const char *unused)
278 unsigned int i; 278 unsigned int i;
279 for (i = 0; envp_init[i]; i++) { 279 for (i = 0; envp_init[i]; i++) {
280 if (i == MAX_INIT_ENVS) { 280 if (i == MAX_INIT_ENVS) {
281 panic_later = "Too many boot env vars at `%s'"; 281 panic_later = "env";
282 panic_param = param; 282 panic_param = param;
283 } 283 }
284 if (!strncmp(param, envp_init[i], val - param)) 284 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 unsigned int i; 290 unsigned int i;
291 for (i = 0; argv_init[i]; i++) { 291 for (i = 0; argv_init[i]; i++) {
292 if (i == MAX_INIT_ARGS) { 292 if (i == MAX_INIT_ARGS) {
293 panic_later = "Too many boot init vars at `%s'"; 293 panic_later = "init";
294 panic_param = param; 294 panic_param = param;
295 } 295 }
296 } 296 }
@@ -582,7 +582,8 @@ asmlinkage void __init start_kernel(void)
582 */ 582 */
583 console_init(); 583 console_init();
584 if (panic_later) 584 if (panic_later)
585 panic(panic_later, panic_param); 585 panic("Too many boot %s vars at `%s'", panic_later,
586 panic_param);
586 587
587 lockdep_info(); 588 lockdep_info();
588 589