[U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM
Stefan Roese
sr at denx.de
Mon Mar 23 09:54:09 CET 2009
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 <wd at denx.de>
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
=====================================================================
More information about the U-Boot
mailing list