mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01: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)
|
if (!m || !choice)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (!m->item_cnt)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
if (!m->prompt)
|
if (!m->prompt)
|
||||||
return menu_default_choice(m, choice);
|
return menu_default_choice(m, choice);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user