summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-02-03 20:05:27 +0100
committerWolfgang Denk <wd@denx.de>2010-02-03 20:05:27 +0100
commit5c1a1a3069c194ac6509344e58f8c96779d2d197 (patch)
tree2948216df92e75bcee9dfdb8d308e6a9a83cbd00 /common
parent0ae016f1ff6b06e94db52373efd08d106bfcecdf (diff)
parentb081c2e9b9329d7dadc8d13fc9a2bae5c90a1204 (diff)
downloadu-boot-imx-5c1a1a3069c194ac6509344e58f8c96779d2d197.zip
u-boot-imx-5c1a1a3069c194ac6509344e58f8c96779d2d197.tar.gz
u-boot-imx-5c1a1a3069c194ac6509344e58f8c96779d2d197.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
Diffstat (limited to 'common')
-rw-r--r--common/env_nand.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/env_nand.c b/common/env_nand.c
index ca631af..a15a950 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -298,6 +298,13 @@ void env_relocate_spec (void)
tmp_env1 = (env_t *) malloc(CONFIG_ENV_SIZE);
tmp_env2 = (env_t *) malloc(CONFIG_ENV_SIZE);
+ if ((tmp_env1 == NULL) || (tmp_env2 == NULL)) {
+ puts("Can't allocate buffers for environment\n");
+ free (tmp_env1);
+ free (tmp_env2);
+ return use_default();
+ }
+
if (readenv(CONFIG_ENV_OFFSET, (u_char *) tmp_env1))
puts("No Valid Environment Area Found\n");
if (readenv(CONFIG_ENV_OFFSET_REDUND, (u_char *) tmp_env2))