projects
/
wrapfs-5.14.y.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6bb162d
)
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
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sun, 21 Nov 2021 12:49:08 +0000
(13:49 +0100)
commit
1ae43851b18afe861120ebd7c426dc44f06bb2bd
upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
init/main.c
patch
|
blob
|
history
diff --git
a/init/main.c
b/init/main.c
index 90733a916791f76c262351f2f0a23d635a47d29d..5840218c06775be7bec3de5ad9adcb6e57cc41e2 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(__pa(new_cmdline), len + 1);
return NULL;
}