All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] common: bootm: check return value of strict_strtoul
@ 2015-11-24  8:54 Peng Fan
  2015-11-24  8:54 ` [U-Boot] [RFC] common: cli_hush: avoid dead code Peng Fan
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Peng Fan @ 2015-11-24  8:54 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-12-06 22:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24  8:54 [U-Boot] [PATCH] common: bootm: check return value of strict_strtoul Peng Fan
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

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.