bootmenu: fix menu API error handling

U-Boot menu framework(common/menu.c) returns 1 if it is successful,
returns negative value if it fails.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Masahisa Kojima
2022-03-24 22:54:33 +09:00
committed by Heinrich Schuchardt
parent 3fb6fa7a71
commit 990f6636ea

View File

@@ -463,7 +463,7 @@ static void bootmenu_show(int delay)
}
for (iter = bootmenu->first; iter; iter = iter->next) {
if (!menu_item_add(menu, iter->key, iter))
if (menu_item_add(menu, iter->key, iter) != 1)
goto cleanup;
}
@@ -476,7 +476,7 @@ static void bootmenu_show(int delay)
init = 1;
if (menu_get_choice(menu, &choice)) {
if (menu_get_choice(menu, &choice) == 1) {
iter = choice;
title = strdup(iter->title);
command = strdup(iter->command);