[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <163171198422.590070.5414135296244084523.stgit@devnote2>
Date: Wed, 15 Sep 2021 22:19:44 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Mike Rapoport <rppt@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Linux-MM <linux-mm@...ck.org>, Vlastimil Babka <vbabka@...e.cz>
Subject: [PATCH v3 2/3] bootconfig: init: Fix memblock leak in setup_boot_config()
Free unused memblock in a error case to fix memblock leak
in setup_boot_config().
Fixes: 7684b8582c24 ("bootconfig: Load boot config from the tail of initrd")
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
init/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/init/main.c b/init/main.c
index 0b054fff8e92..4f059fde1df0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -459,6 +459,7 @@ static void __init setup_boot_config(void)
else
pr_err("Failed to parse bootconfig: %s at %d.\n",
msg, pos);
+ memblock_free_ptr(copy, size + 1);
} else {
pr_info("Load bootconfig: %d bytes %d nodes\n", size, ret);
/* keys starting with "kernel." are passed via cmdline */
Powered by blists - more mailing lists