summaryrefslogtreecommitdiff
path: root/common/env_nand.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-02-07 23:51:52 +0100
committerWolfgang Denk <wd@denx.de>2009-02-07 23:51:52 +0100
commitf8306cb94f59ae2ace5bfede189944d329e5abb3 (patch)
treec26c402b9d1c3d28f5a54ffd4fcd2f3a393772de /common/env_nand.c
parent657f2062d8e17ebf4a55f52c9e71c07c0c94c779 (diff)
parent2d43e873a29ca4959ba6a30fc7fb396d3fd0dccf (diff)
downloadu-boot-imx-f8306cb94f59ae2ace5bfede189944d329e5abb3.zip
u-boot-imx-f8306cb94f59ae2ace5bfede189944d329e5abb3.tar.gz
u-boot-imx-f8306cb94f59ae2ace5bfede189944d329e5abb3.tar.bz2
Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/master
Diffstat (limited to 'common/env_nand.c')
-rw-r--r--common/env_nand.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/env_nand.c b/common/env_nand.c
index 8af9e74..e490775 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -304,9 +304,11 @@ void env_relocate_spec (void)
crc1_ok = (crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc);
crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
- if(!crc1_ok && !crc2_ok)
+ if(!crc1_ok && !crc2_ok) {
+ free(tmp_env1);
+ free(tmp_env2);
return use_default();
- else if(crc1_ok && !crc2_ok)
+ } else if(crc1_ok && !crc2_ok)
gd->env_valid = 1;
else if(!crc1_ok && crc2_ok)
gd->env_valid = 2;