mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
bootconfig: init: Fix memblock leak in xbc_make_cmdline()
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: 51887d03ac ("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>
This commit is contained in:
committed by
Steven Rostedt (VMware)
parent
6675880fc4
commit
1ae43851b1
@@ -382,6 +382,7 @@ static char * __init xbc_make_cmdline(const char *key)
|
|||||||
ret = xbc_snprint_cmdline(new_cmdline, len + 1, root);
|
ret = xbc_snprint_cmdline(new_cmdline, len + 1, root);
|
||||||
if (ret < 0 || ret > len) {
|
if (ret < 0 || ret > len) {
|
||||||
pr_err("Failed to print extra kernel cmdline.\n");
|
pr_err("Failed to print extra kernel cmdline.\n");
|
||||||
|
memblock_free_ptr(new_cmdline, len + 1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user