Merge branch 'akpm' (patches from Andrew)
[platform/kernel/linux-rpi.git] / init / main.c
index 183f861..bb984ed 100644 (file)
@@ -381,7 +381,7 @@ static char * __init xbc_make_cmdline(const char *key)
        ret = xbc_snprint_cmdline(new_cmdline, len + 1, root);
        if (ret < 0 || ret > len) {
                pr_err("Failed to print extra kernel cmdline.\n");
-               memblock_free_ptr(new_cmdline, len + 1);
+               memblock_free(new_cmdline, len + 1);
                return NULL;
        }
 
@@ -915,8 +915,10 @@ static void __init print_unknown_bootoptions(void)
        for (p = &envp_init[2]; *p; p++)
                end += sprintf(end, " %s", *p);
 
-       pr_notice("Unknown command line parameters:%s\n", unknown_options);
-       memblock_free_ptr(unknown_options, len);
+       /* Start at unknown_options[1] to skip the initial space */
+       pr_notice("Unknown kernel command line parameters \"%s\", will be passed to user space.\n",
+               &unknown_options[1]);
+       memblock_free(unknown_options, len);
 }
 
 asmlinkage __visible void __init __no_sanitize_address start_kernel(void)
@@ -1497,6 +1499,8 @@ static int __ref kernel_init(void *unused)
        kernel_init_freeable();
        /* need to finish all async __init code before freeing the memory */
        async_synchronize_full();
+
+       system_state = SYSTEM_FREEING_INITMEM;
        kprobe_free_init_mem();
        ftrace_free_init_mem();
        kgdb_free_init_mem();