mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00: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
1 changed files with 3 additions and 0 deletions
|
@ -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 a new issue