From: Bryan Wu Date: Fri, 15 Aug 2014 16:51:39 -0700 Subject: [U-Boot] [PATCH 2/2] bootm: make sure pass NULL when argc < 1 In-Reply-To: <1408146699-27959-1-git-send-email-pengw@nvidia.com> References: <1408146699-27959-1-git-send-email-pengw@nvidia.com> Message-ID: <1408146699-27959-2-git-send-email-pengw@nvidia.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de arg[0] might not be NULL even if argc < 1, so fix this as before. Signed-off-by: Bryan Wu --- common/bootm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index 245c82a..ff81a27 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -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); -- 1.9.1