projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6675880
)
bootconfig: init: Fix memblock leak in xbc_make_cmdline()
author
Masami Hiramatsu
<mhiramat@kernel.org>
Thu, 16 Sep 2021 06:23:12 +0000
(15:23 +0900)
committer
Steven Rostedt (VMware)
<rostedt@goodmis.org>
Mon, 11 Oct 2021 02:27:40 +0000
(22:27 -0400)
Free unused memblock in a error case to fix memblock leak
in xbc_make_cmdline().
Link:
https://lkml.kernel.org/r/163177339181.682366.8713781325929549256.stgit@devnote2
Fixes: 51887d03aca1 ("bootconfig: init: Allow admin to use bootconfig for kernel command line")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
init/main.c
patch
|
blob
|
history
diff --git
a/init/main.c
b/init/main.c
index 81a79a77db46c119648ed019a3b7eb1386079532..3c4054a9554580a8b65ea5caa33493d1ee825748 100644
(file)
--- a/
init/main.c
+++ b/
init/main.c
@@
-382,6
+382,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);
return NULL;
}