public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors
Date: Tue, 18 May 2010 10:20:55 +0200	[thread overview]
Message-ID: <201005181020.55735.sr@denx.de> (raw)
In-Reply-To: <1274160395-9308-1-git-send-email-mark.tomlinson@alliedtelesis.co.nz>

Hi Mark,

On Tuesday 18 May 2010 07:26:34 Mark Tomlinson wrote:
> 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.

Just to be sure: You have 2 FLASH chips? Mapped at which addresses? And where 
does CONFIG_SYS_MONITOR_BASE point to?
 
> 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.

You mean that "flash_get_info(CONFIG_SYS_MONITOR_BASE)" returns NULL? Please 
explain again, why is this the case? 

> 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.

I would prefer to fix the real problem, that flash_get_info() returns NULL, 
instead.
 
Cheers,
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

  parent reply	other threads:[~2010-05-18  8:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18  5:26 [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors Mark Tomlinson
2010-05-18  5:26 ` [U-Boot] [PATCH 1/1] flash: Check info pointer in flash_protect() Mark Tomlinson
2010-05-19 22:22   ` Mike Frysinger
2010-05-20  8:38   ` Wolfgang Denk
2010-05-18  8:20 ` Stefan Roese [this message]
2010-05-18 20:10   ` [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors mark tomlinson
2010-05-19  9:44     ` Stefan Roese
2010-05-19 21:09       ` mark tomlinson
2010-05-19 21:59         ` Wolfgang Denk
2010-05-19 23:08           ` Chris Packham
2010-05-20  8:35             ` Wolfgang Denk
2010-05-20 18:59               ` Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201005181020.55735.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox