summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/env_nand.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/env_nand.c b/common/env_nand.c
index a5e1038..d38bcca 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -266,6 +266,8 @@ int readenv (size_t offset, u_char * buf)
u_char *char_ptr;
blocksize = nand_info[0].erasesize;
+ if (!blocksize)
+ return 1;
len = min(blocksize, CONFIG_ENV_SIZE);
while (amount_loaded < CONFIG_ENV_SIZE && offset < end) {