[U-Boot] [PATCH 3/3] bootm: make sure pass NULL when argc < 1

Bryan Wu cooloney at gmail.com
Fri Aug 15 22:55:28 CEST 2014


arg[0] might not be NULL even if argc < 1, so fix this as before.

Signed-off-by: Bryan Wu <pengw at nvidia.com>
---
 common/bootm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/bootm.c b/common/bootm.c
index 85b71ba..e75a825 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -732,10 +732,11 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
 #endif
 
 #if defined(CONFIG_FIT)
-	img_addr = genimg_get_kernel_addr(argv[0], &fit_uname_config,
+	img_addr = genimg_get_kernel_addr(argc < 1 ? NULL : argv[0],
+					  &fit_uname_config,
 					  &fit_uname_kernel);
 #else
-	img_addr = genimg_get_kernel_addr(argv[0]);
+	img_addr = genimg_get_kernel_addr(argc < 1 ? NULL : argv[0]);
 #endif
 
 	bootstage_mark(BOOTSTAGE_ID_CHECK_MAGIC);
-- 
1.9.1



More information about the U-Boot mailing list