[U-Boot] [PATCH] Fix incorrect use of getenv() before relocation

Wolfgang Denk wd at denx.de
Thu May 12 19:49:32 CEST 2011


Dear Wolfgang Denk,

In message <1304541148-11038-1-git-send-email-wd at denx.de> you wrote:
> A large number of boards incorrectly used getenv() in their board init
> code running before relocation.  In some cases this caused U-Boot to
> hang when certain environment variables grew too long.
> Fix the code to use getenv_r().
> 
> Signed-off-by: Wolfgang Denk <wd at denx.de>
> Cc: Stefan Roese <sr at denx.de>
> Cc: The LEOX team <team at leox.org>
> Cc: Michael Schwingen <michael at schwingen.org>
> Cc: Georg Schardt <schardt at team-ctech.de>
> Cc: Werner Pfister <Pfister_Werner at intercontrol.de>
> Cc: Dirk Eibach <eibach at gdsys.de>
> Cc: Peter De Schrijver <p2 at mind.be>
> Cc: John Zhan <zhanz at sinovee.com>
> Cc: Rishi Bhattacharya <rishi at ti.com>
> Cc: Peter Tyser <ptyser at xes-inc.com>
> ---
>  board/LEOX/elpt860/elpt860.c          |    5 +++--
>  board/RRvision/RRvision.c             |   10 ++++++----
>  board/actux1/actux1.c                 |    9 +++++----
>  board/actux2/actux2.c                 |    9 +++++----
>  board/actux3/actux3.c                 |    7 ++++---
>  board/amcc/acadia/acadia.c            |    7 ++++---
>  board/amcc/bamboo/bamboo.c            |    7 ++++---
>  board/amcc/bluestone/bluestone.c      |    7 ++++---
>  board/amcc/bubinga/bubinga.c          |    7 ++++---
>  board/amcc/canyonlands/canyonlands.c  |    7 ++++---
>  board/amcc/ebony/ebony.c              |    7 ++++---
>  board/amcc/katmai/katmai.c            |    7 ++++---
>  board/amcc/kilauea/kilauea.c          |    7 ++++---
>  board/amcc/luan/luan.c                |    7 ++++---
>  board/amcc/makalu/makalu.c            |    7 ++++---
>  board/amcc/ocotea/ocotea.c            |    9 +++++----
>  board/amcc/redwood/redwood.c          |    7 ++++---
>  board/amcc/sequoia/sequoia.c          |    7 ++++---
>  board/amcc/taihu/taihu.c              |    7 ++++---
>  board/amcc/taishan/taishan.c          |    9 +++++----
>  board/amcc/walnut/walnut.c            |    7 ++++---
>  board/amcc/yosemite/yosemite.c        |    7 ++++---
>  board/amcc/yucca/yucca.c              |    7 ++++---
>  board/amirix/ap1000/ap1000.c          |   24 ++++++++++++++----------
>  board/avnet/fx12mm/fx12mm.c           |   17 ++++++++---------
>  board/c2mon/c2mon.c                   |   10 ++++++----
>  board/digsy_mtc/digsy_mtc.c           |    9 +++++----
>  board/etx094/etx094.c                 |   16 +++++++---------
>  board/gdsys/405ep/dlvision-10g.c      |    7 ++++---
>  board/gdsys/405ep/io.c                |    7 ++++---
>  board/gdsys/405ep/iocon.c             |    7 ++++---
>  board/gdsys/dlvision/dlvision.c       |    7 ++++---
>  board/gdsys/gdppc440etx/gdppc440etx.c |    7 ++++---
>  board/gdsys/intip/intip.c             |    7 ++++---
>  board/gdsys/neo/neo.c                 |    7 ++++---
>  board/gw8260/gw8260.c                 |    8 ++++----
>  board/hermes/hermes.c                 |   16 +++++++---------
>  board/ixdp425/ixdp425.c               |    7 ++++---
>  board/lwmon5/lwmon5.c                 |    7 ++++---
>  board/micronas/vct/vct.c              |    7 ++++---
>  board/ml2/ml2.c                       |   18 +++++++-----------
>  board/mosaixtech/icon/icon.c          |    7 ++++---
>  board/pcs440ep/pcs440ep.c             |    7 ++++---
>  board/prodrive/alpr/alpr.c            |    9 +++++----
>  board/prodrive/p3mx/p3mx.c            |    7 ++++---
>  board/prodrive/p3p440/p3p440.c        |    7 ++++---
>  board/prodrive/pdnb3/pdnb3.c          |    7 ++++---
>  board/quad100hd/quad100hd.c           |    7 ++++---
>  board/quantum/quantum.c               |   10 ++++++----
>  board/rbc823/rbc823.c                 |    9 +++++----
>  board/socrates/socrates.c             |   12 +++++++-----
>  board/svm_sc8xx/svm_sc8xx.c           |   32 +++++++++++++++++---------------
>  board/t3corp/t3corp.c                 |    7 ++++---
>  board/ti/omap5912osk/omap5912osk.c    |    7 ++++---
>  board/tqc/tqm8260/tqm8260.c           |    8 ++++----
>  board/tqc/tqm8272/tqm8272.c           |    8 ++++++--
>  board/tqc/tqm85xx/tqm85xx.c           |   19 +++++++++++--------
>  board/tqc/tqm8xx/tqm8xx.c             |   18 ++++++++++--------
>  board/xes/common/board.c              |   17 +++++++++++------
>  board/xes/xpedite1000/xpedite1000.c   |   21 +++++++++++----------
>  board/zeus/zeus.c                     |    7 ++++---
>  61 files changed, 324 insertions(+), 260 deletions(-)

Applied (with fix for board/digsy_mtc/digsy_mtc.c as pointed out by
Detlev).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In the beginning, there was nothing, which exploded.
                                - Terry Pratchett, _Lords and Ladies_


More information about the U-Boot mailing list