summaryrefslogtreecommitdiff
path: root/common/image.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-08-29 19:08:29 -0500
committerWolfgang Denk <wd@denx.de>2008-09-07 00:18:50 +0200
commitea86b9e64b811753d9eabe0f560ee189fbe5d0c1 (patch)
tree70af82b4e01fbc3da58032dc18580cac02c98cf8 /common/image.c
parent8e02494e8f86c8f2d7324b5eb9e75271104a01ef (diff)
downloadu-boot-imx-ea86b9e64b811753d9eabe0f560ee189fbe5d0c1.zip
u-boot-imx-ea86b9e64b811753d9eabe0f560ee189fbe5d0c1.tar.gz
u-boot-imx-ea86b9e64b811753d9eabe0f560ee189fbe5d0c1.tar.bz2
Prevent crash if random/invalid ramdisks are passed to bootm
Adds returning an error from the ramdisk detection code if its not a real ramdisk (invalid). There is no reason we can't just return back to the console if we detect an invalid ramdisk or CRC error. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'common/image.c')
-rw-r--r--common/image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/image.c b/common/image.c
index 0acdcf1..94f01ad 100644
--- a/common/image.c
+++ b/common/image.c
@@ -749,7 +749,7 @@ int genimg_has_config (bootm_headers_t *images)
* rd_start and rd_end are set to ramdisk start/end addresses if
* ramdisk image is found and valid
*
- * 1, if ramdisk image is found but corrupted
+ * 1, if ramdisk image is found but corrupted, or invalid
* rd_start and rd_end are set to 0 if no ramdisk exists
*/
int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
@@ -936,6 +936,7 @@ int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
default:
puts ("Wrong Ramdisk Image Format\n");
rd_data = rd_len = rd_load = 0;
+ return 1;
}
#if defined(CONFIG_B2) || defined(CONFIG_EVB4510) || defined(CONFIG_ARMADILLO)