From 794e4aa6a5aa5fbe71b08bfe8f5f5f65078fbc68 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Tue, 23 Mar 2010 09:12:16 -0700 Subject: [PATCH 16/37] env_nand.c: fail gracefully if no nand is present --- common/env_nand.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/common/env_nand.c b/common/env_nand.c index a15a950..325f112 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -268,6 +268,10 @@ int readenv (size_t offset, u_char * buf) u_char *char_ptr; + /* fail if no nand detected */ + if (nand_info[0].type == 0) + return 1; + blocksize = nand_info[0].erasesize; len = min(blocksize, CONFIG_ENV_SIZE); -- 1.6.6.1