bootm: make sure pass NULL when argc < 1
authorBryan Wu <cooloney@gmail.com>
Fri, 15 Aug 2014 23:51:39 +0000 (16:51 -0700)
committerTom Rini <trini@ti.com>
Thu, 21 Aug 2014 16:01:30 +0000 (12:01 -0400)
arg[0] might not be NULL even if argc < 1, so fix this as before.

Signed-off-by: Bryan Wu <pengw@nvidia.com>
common/bootm.c

index 245c82aceb5c6af78bc45a2765496b04c6ebf01d..ff81a271a559232c07e3f7c1cbebc4bf327731c3 100644 (file)
@@ -731,8 +731,9 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
        int             os_noffset;
 #endif
 
-       img_addr = genimg_get_kernel_addr_fit(argv[0], &fit_uname_config,
-                                         &fit_uname_kernel);
+       img_addr = genimg_get_kernel_addr_fit(argc < 1 ? NULL : argv[0],
+                                             &fit_uname_config,
+                                             &fit_uname_kernel);
 
        bootstage_mark(BOOTSTAGE_ID_CHECK_MAGIC);