Skip to content
Snippets Groups Projects
Commit ee038c58 authored by Ley Foon Tan's avatar Ley Foon Tan Committed by Tom Rini
Browse files

malloc: Use malloc simple before malloc is fully initialized in memalign()


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: default avatarLey Foon Tan <ley.foon.tan@intel.com>
Reviewed-by: default avatarMarek Vasut <marek.vasut@gmail.com>
parent 635159a0
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment