Thread (19 messages) 19 messages, 1 author, 2016-07-22
STALE3639d

[PATCH 11/18] bootentries: Move menu display string allocation to bootentries_alloc()

From: Sascha Hauer <s.hauer@pengutronix.de>
Date: 2016-07-22 12:44:50
Subsystem: the rest · Maintainer: Linus Torvalds

bootentries_alloc() is the place where the struct bootentries container
is allocated, so allocate the menu entry there aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/boot.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/commands/boot.c b/commands/boot.c
index 1ae2745..f193c93 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -50,8 +50,10 @@ static struct bootentries *bootentries_alloc(void)
 	bootentries = xzalloc(sizeof(*bootentries));
 	INIT_LIST_HEAD(&bootentries->entries);
 
-	if (IS_ENABLED(CONFIG_MENU))
+	if (IS_ENABLED(CONFIG_MENU)) {
 		bootentries->menu = menu_alloc();
+		bootentries->menu->display = basprintf("boot");
+	}
 
 	return bootentries;
 }
@@ -294,9 +296,6 @@ static struct bootentries *bootentries_collect(char *entries[], int num_entries)
 
 	bootentries = bootentries_alloc();
 
-	if (IS_ENABLED(CONFIG_MENU))
-		bootentries->menu->display = basprintf("boot");
-
 	if (!num_entries)
 		bootscript_scan_path(bootentries, "/env/boot");
 
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help