Skip to contentSkip to conversation

Prevent crash if random DTB address is passed to bootm

RFC PATCH New Anatolij Gustschin 2 participants 2 messages Aug 29, 2008 – Sep 6, 2008

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Prevent crash if random DTB address is passed to bootm

This patch adds bootm_start() return value check. If error status is returned, we do not proceed further to prevent board reset or crash as we still can recover at this point.

---
 common/cmd_bootm.c |    3 ++-
 common/image.c     |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
common/cmd_bootm.c +2 -1
index 0db7b75..374085c 100644
@@ -361,7 +361,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	ulong		load_end = 0;
 	int		ret;
 
-	bootm_start(cmdtp, flag, argc, argv);
+	if (bootm_start(cmdtp, flag, argc, argv))
+		return 1;
 
 	/*
 	 * We have reached the point of no return: we are going to
common/image.c +1 -1
index 55c4cce..0acdcf1 100644
@@ -1516,7 +1516,7 @@ int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images,
 			}
 			break;
 		default:
-			fdt_error ("Did not find a cmdline Flattened Device Tree");
+			puts ("ERROR: Did not find a cmdline Flattened Device Tree\n");
 			goto error;
 		}
 
Signature · 1 line
1.5.3.3
#1 lore raw

RFC PATCH 1/1 Prevent crash if random DTB address is passed to bootm

Dear Anatolij Gustschin,

Quoted 10 lines · In message <[email protected]> you wrote:

This patch adds bootm_start() return value check. If error status is returned, we do not proceed further to prevent board reset or crash as we still can recover at this point.

---
 common/cmd_bootm.c |    3 ++-
 common/image.c     |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The heart is not a logical organ.
	-- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4