[U-Boot] [PATCH] malloc: Fix issue with calloc memory possibly being non-zero

Kumar Gala galak at kernel.crashing.org
Tue Nov 16 01:35:43 CET 2010


On Nov 15, 2010, at 4:06 PM, Wolfgang Denk wrote:

> Dear Kumar Gala,
> 
> In message <1289854274-7006-1-git-send-email-galak at kernel.crashing.org> you wrote:
>> Since we set #define MORECORE_CLEARS 1, the code assumes 'sbrk' always
>> returns zero'd out memory.  However since its possible that free()
>> returns memory ack to sbrk() via malloc_trim we could possible get
>> non-zero'd memory from sbrk() if it allocates back memory that was
>> previously freed to it.
> 
> I confirm that the test case works fine here, too.  So:
> 
> Tested-by: Wolfgang Denk <wd at denx.de>
> 
> 
> But the commit message needs serious rework before this can get
> applied.

Oops, will fix and repost.

- k


More information about the U-Boot mailing list