From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 28 May 2018 15:13:40 -0400 Subject: [U-Boot] malloc: Use malloc simple before malloc is fully initialized in memalign() In-Reply-To: <1526637792-33233-1-git-send-email-ley.foon.tan@intel.com> References: <1526637792-33233-1-git-send-email-ley.foon.tan@intel.com> Message-ID: <20180528191340.GS21194@bill-the-cat.ec.rr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Reviewed-by: Marek Vasut 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: