mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-27 14:14:37 +08:00
menu: menu_get_choice() return -ENOENT if menu item is empty
menu_get_choice() needs to handle the case that menu item is empty. In this case, menu_get_choice() returns -ENOENT. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
c23bb03465
commit
7f67525f99
@ -271,6 +271,9 @@ int menu_get_choice(struct menu *m, void **choice)
|
||||
if (!m || !choice)
|
||||
return -EINVAL;
|
||||
|
||||
if (!m->item_cnt)
|
||||
return -ENOENT;
|
||||
|
||||
if (!m->prompt)
|
||||
return menu_default_choice(m, choice);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user