[U-Boot] [PATCH] malloc: return NULL if not initialized yet

Wolfgang Denk wd at denx.de
Sun Jan 17 18:59:29 CET 2010


In message <1263551117-26553-1-git-send-email-wd at denx.de> you wrote:
> When malloc() was called before it was properly initialized
> (as would happen if when used before relocation to RAM) it returned
> random, non-NULL values, which called all kinds of difficult to debug
> subsequent errors.
> 
> Make sure to return NULL when initialization was not done yet.
> 
> Signed-off-by: Wolfgang Denk <wd at denx.de>
> ---
>  common/dlmalloc.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)

Applied (with change as suggested by Mike).

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
Disobedience:  The silver lining to the cloud of servitude.
- Ambrose Bierce


More information about the U-Boot mailing list