summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/bootm_os.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/boot/bootm_os.c b/boot/bootm_os.c
index ae20b555f5c..69aa577a2fc 100644
--- a/boot/bootm_os.c
+++ b/boot/bootm_os.c
@@ -599,5 +599,7 @@ int boot_selected_os(int state, struct bootm_info *bmi, boot_os_fn *boot_fn)
boot_os_fn *bootm_os_get_boot_func(int os)
{
+ if (os < 0 || os >= ARRAY_SIZE(boot_os))
+ return NULL;
return boot_os[os];
}