All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] bootm: make sure pass NULL when argc < 1
Date: Fri, 15 Aug 2014 13:55:28 -0700	[thread overview]
Message-ID: <1408136128-16240-3-git-send-email-pengw@nvidia.com> (raw)
In-Reply-To: <1408136128-16240-1-git-send-email-pengw@nvidia.com>

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 | 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

  parent reply	other threads:[~2014-08-15 20:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15 20:55 [U-Boot] [PATCH v2 1/3] image: fix bootm failure for FIT image Bryan Wu
2014-08-15 20:55 ` [U-Boot] [PATCH 2/3] image: move all function comments to header file Bryan Wu
2014-08-15 22:01   ` Jeroen Hofstee
2014-08-15 22:07     ` Bryan Wu
2014-08-15 22:10       ` York Sun
2014-08-15 22:11         ` Bryan Wu
2014-08-15 22:14           ` Stephen Warren
2014-08-15 22:25             ` York Sun
2014-08-15 22:56               ` Bryan Wu
2014-08-18 18:18                 ` Simon Glass
2014-08-23 12:42   ` [U-Boot] [U-Boot, " Tom Rini
2014-08-23 17:48     ` Tom Rini
2014-09-19 23:17       ` Simon Glass
2014-09-20  5:34         ` Masahiro YAMADA
2014-09-20  7:39           ` Albert ARIBAUD
2014-09-22  6:41           ` Simon Glass
2014-08-15 20:55 ` Bryan Wu [this message]
2014-08-22 20:36 ` [U-Boot] [PATCH v2 1/3] image: fix bootm failure for FIT image Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408136128-16240-3-git-send-email-pengw@nvidia.com \
    --to=cooloney@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.