From: Masahisa Kojima Date: Thu, 24 Mar 2022 13:54:33 +0000 (+0900) Subject: bootmenu: fix menu API error handling X-Git-Tag: baikal/mips/sdk5.9~3^2~84^2~12 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=89481dd8d382089fa84cb3a62f056d945f4a369e;p=uboot.git 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 Acked-by: Ilias Apalodimas --- diff --git a/cmd/bootmenu.c b/cmd/bootmenu.c index 409ef9a848..d573487272 100644 --- a/cmd/bootmenu.c +++ b/cmd/bootmenu.c @@ -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);