All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <Peng.Fan@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] common: bootm: check return value of strict_strtoul
Date: Tue, 24 Nov 2015 16:54:20 +0800	[thread overview]
Message-ID: <1448355263-545-1-git-send-email-Peng.Fan@freescale.com> (raw)

Before continue, check return value of strict_strtoul.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Simon Glass <sjg@chromium.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: York Sun <yorksun@freescale.com>
Cc: Tom Rini <trini@konsulko.com>
---
 arch/arm/lib/bootm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index ee56d74..a477cae 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -290,7 +290,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
 
 	s = getenv("machid");
 	if (s) {
-		strict_strtoul(s, 16, &machid);
+		if (strict_strtoul(s, 16, &machid) < 0) {
+			debug("strict_strtoul failed!\n");
+			return;
+		}
 		printf("Using machid 0x%lx from environment\n", machid);
 	}
 
-- 
2.6.2

             reply	other threads:[~2015-11-24  8:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24  8:54 Peng Fan [this message]
2015-11-24  8:54 ` [U-Boot] [RFC] common: cli_hush: avoid dead code Peng Fan
2015-11-24 19:04   ` Simon Glass
2015-12-06 22:06   ` [U-Boot] [U-Boot,RFC] " Tom Rini
2015-11-24  8:54 ` [U-Boot] [PATCH] common: image-fdt: correct fdt_blob for IMAGE_FORMAT_LEGACY Peng Fan
2015-11-24 19:04   ` Simon Glass
2015-11-25  1:12     ` Peng Fan
2015-12-01 20:01       ` Simon Glass
2015-12-06 22:06   ` [U-Boot] " Tom Rini
2015-11-24  8:54 ` [U-Boot] [PATCH] video: ipu: simplify if else code Peng Fan
2015-11-24  9:55   ` Stefano Babic
2015-11-24 19:04 ` [U-Boot] [PATCH] common: bootm: check return value of strict_strtoul Simon Glass
2015-12-06 22:05 ` [U-Boot] " Tom Rini

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=1448355263-545-1-git-send-email-Peng.Fan@freescale.com \
    --to=peng.fan@freescale.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.