[U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors

Mark Tomlinson mark.tomlinson at alliedtelesis.co.nz
Tue May 18 07:26:34 CEST 2010


Our hardware has part of the flash mapped in two address ranges.
The CONFIG_SYS_MONITOR_BASE is in the upper 'boot' area, whereas
the CONFIG_SYS_FLASH_BANKS_LIST has the full flash available at
a lower address.

This all works fine until the code in cfi_flash.c:flash_init(), which
uses flash_get_info() to find the flash_info_t associated with the
monitor and environment. These are not in the probed flash range, so
flash_get_info() returns NULL. This is not checked and is passed
directly to flash_protect(). Since flash_protect() was not checking
for this NULL pointer either, random memory would be clobbered
causing the device to lock up.

This patch changes flash_protect() to check for the NULL, and the
error goes unreported.

Mark Tomlinson (1):
  flash: Check info pointer in flash_protect().

 common/flash.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


NOTICE: This message contains privileged and confidential
information intended only for the use of the addressee
named above. If you are not the intended recipient of
this message you are hereby notified that you must not
disseminate, copy or take any action in reliance on it.
If you have received this message in error please
notify Allied Telesis Labs Ltd immediately.
Any views expressed in this message are those of the
individual sender, except where the sender has the
authority to issue and specifically states them to
be the views of Allied Telesis Labs.


More information about the U-Boot mailing list