Skip to content

Commit 611d0a9

Browse files
mhiramatrostedt
authored andcommitted
bootconfig: Fix to prevent warning message if no bootconfig option
Commit de462e5 ("bootconfig: Fix to remove bootconfig data from initrd while boot") causes a cosmetic regression on dmesg, which warns "no bootconfig data" message without bootconfig cmdline option. Fix setup_boot_config() by moving no bootconfig check after commandline option check. Link: http://lkml.kernel.org/r/[email protected] Link: http://lkml.kernel.org/r/158916116468.21787.14558782332170588206.stgit@devnote2 Fixes: de462e5 ("bootconfig: Fix to remove bootconfig data from initrd while boot") Reported-by: Paul Menzel <[email protected]> Reviewed-by: Paul Menzel <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 8b1fac2 commit 611d0a9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

init/main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,8 @@ static void __init setup_boot_config(const char *cmdline)
400400
char *data, *copy;
401401
int ret;
402402

403+
/* Cut out the bootconfig data even if we have no bootconfig option */
403404
data = get_boot_config_from_initrd(&size, &csum);
404-
if (!data)
405-
goto not_found;
406405

407406
strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE);
408407
parse_args("bootconfig", tmp_cmdline, NULL, 0, 0, 0, NULL,
@@ -411,6 +410,11 @@ static void __init setup_boot_config(const char *cmdline)
411410
if (!bootconfig_found)
412411
return;
413412

413+
if (!data) {
414+
pr_err("'bootconfig' found on command line, but no bootconfig found\n");
415+
return;
416+
}
417+
414418
if (size >= XBC_DATA_MAX) {
415419
pr_err("bootconfig size %d greater than max size %d\n",
416420
size, XBC_DATA_MAX);
@@ -446,8 +450,6 @@ static void __init setup_boot_config(const char *cmdline)
446450
extra_init_args = xbc_make_cmdline("init");
447451
}
448452
return;
449-
not_found:
450-
pr_err("'bootconfig' found on command line, but no bootconfig found\n");
451453
}
452454

453455
#else

0 commit comments

Comments
 (0)