]> Git Repo - linux.git/commitdiff
init/main.c: Minor cleanup for the setup_command_line() function
authorYuntao Wang <[email protected]>
Fri, 12 Apr 2024 08:17:33 +0000 (16:17 +0800)
committerMasami Hiramatsu (Google) <[email protected]>
Fri, 12 Apr 2024 16:03:13 +0000 (01:03 +0900)
This is just a minor cleanup to make the code look a bit cleaner.

Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Yuntao Wang <[email protected]>
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
init/main.c

index 02156c3c58798c3dc6211c8da58b3c221d55306e..383796015113e4a5f8858a7b8d15c29b2f6dea41 100644 (file)
@@ -633,11 +633,11 @@ static void __init setup_command_line(char *command_line)
                ilen = strlen(extra_init_args) + 4; /* for " -- " */
        }
 
-       len = xlen + strlen(boot_command_line) + 1;
+       len = xlen + strlen(boot_command_line) + ilen + 1;
 
-       saved_command_line = memblock_alloc(len + ilen, SMP_CACHE_BYTES);
+       saved_command_line = memblock_alloc(len, SMP_CACHE_BYTES);
        if (!saved_command_line)
-               panic("%s: Failed to allocate %zu bytes\n", __func__, len + ilen);
+               panic("%s: Failed to allocate %zu bytes\n", __func__, len);
 
        len = xlen + strlen(command_line) + 1;
 
This page took 0.055435 seconds and 4 git commands to generate.