From: Scott Wood Date: Fri, 13 Aug 2010 13:33:26 -0500 Subject: [U-Boot] [PATCH] env_nand: return error when no device is found In-Reply-To: <1281584546-22364-1-git-send-email-vapier@gentoo.org> References: <1281584546-22364-1-git-send-email-vapier@gentoo.org> Message-ID: <20100813183326.GA27014@schlenkerla.am.freescale.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Aug 11, 2010 at 11:42:26PM -0400, Mike Frysinger wrote: > Currently, if there is an error probing the NAND chip and the env is based > in NAND, the readenv() function will use a NULL function pointer and thus > jump to address 0. > > Here I just check for a non-zero value of blocksize as that shouldn't be > zero when a valid device is found, but perhaps there is a better way for > someone familiar with the NAND internals to suggest. > > Signed-off-by: Mike Frysinger > --- > common/env_nand.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) Applied to u-boot-nand-flash. -Scott