[U-Boot] malloc: Use malloc simple before malloc is fully initialized in memalign()

Tom Rini trini at konsulko.com
Mon May 28 19:13:40 UTC 2018


On Fri, May 18, 2018 at 06:03:12PM +0800, Ley Foon Tan wrote:

> Follow implementation in mALLOc(). Check GD_FLG_FULL_MALLOC_INIT flag and use
> malloc_simple if GD_FLG_FULL_MALLOC_INIT is unset. Adjust the malloc bytes
> to align with the requested alignment.
> 
> The original memalign() function will access mchunkptr struct to adjust the
> alignment if there is misalignment happen, but mchunkptr struct is not being
> initialized before full malloc is initialized. This cause the system crash.
> 
> Signed-off-by: Ley Foon Tan <ley.foon.tan at intel.com>
> Reviewed-by: Marek Vasut <marek.vasut at gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180528/46a061ea/attachment.sig>


More information about the U-Boot mailing list