From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Mon, 23 Mar 2009 09:54:09 +0100 Subject: [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM In-Reply-To: <20090323081738.912F6832E406@gemini.denx.de> References: <20090321135934.12464.65400.stgit@localhost> <20090323081738.912F6832E406@gemini.denx.de> Message-ID: <200903230954.09491.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wolfgang, On Monday 23 March 2009, Wolfgang Denk wrote: > > +++ b/drivers/mtd/cfi_flash.c > > @@ -2009,7 +2009,9 @@ unsigned long flash_init (void) > > #endif > > > > #ifdef CONFIG_SYS_FLASH_PROTECTION > > - char *s = getenv("unlock"); > > + /* read environment from EEPROM */ > > + char s[4]; > > + getenv_r ("unlock", s, sizeof(s)); > > #endif > > > > #define BANK_BASE(i) (((phys_addr_t > > [CFI_MAX_FLASH_BANKS])CONFIG_SYS_FLASH_BANKS_LIST)[i]) > > Please change "char s[4];" into "char s[256];", otherwise: > > Acked-by: Wolfgang Denk OK, I changed the array to 64 (256 is a bit high without "real" stack) and will push this patch quickly to the cfi repository. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================