From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 15 Aug 2016 12:13:33 -0500 Subject: [U-Boot] [PATCH v3] common: env_nand: Ensure that we have nand_info[0] prior to use In-Reply-To: <1471280535-3897-1-git-send-email-trini@konsulko.com> References: <1471280535-3897-1-git-send-email-trini@konsulko.com> Message-ID: <1471281213.25630.272.camel@buserror.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 Mon, 2016-08-15 at 13:02 -0400, Tom Rini wrote: > Now that nand_info[] is an array of pointers we need to ensure that it's > been populated prior to use.??We may for example have ENV in NAND set in > configurations that run on boards with and without NAND (where default > env is fine enough, such as omap3_beagle and beagleboard (NAND) vs > beagle xM (no NAND)). > > Fixes: b616d9b0a708 ("nand: Embed mtd_info in struct nand_chip") > Cc: Scott Wood > Signed-off-by: Tom Rini > --- > Changes in v3: > - Don't overload the blocksize check in readenv(), and now that > ? blocksize would never be zero (this was the previous way to see that > ? we had no NAND detected), remove that check. > - Address the CONFIG_ENV_OFFSET_OOB case in env_relocate_spec() as this > ? too would fail now if no NAND was detected. > > Changes in v2: > - Oops, move check on the saveenv side in to erase_and_write_env > --- > ?common/env_nand.c | 11 +++++++---- > ?1 file changed, 7 insertions(+), 4 deletions(-) Acked-by: Scott Wood -Scott