mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
malloc: Fix memalign not honoring alignment prior to full malloc init
When using memalign() in a scenario where U-Boot is configured for full
malloc support with simple malloc not explicitly enabled and before the
full malloc support is initialized, a memory block is being allocated
and returned without the alignment parameter getting honored.
Fix this issue by replacing the existing memalign pre-full malloc init
logic with a call to memalign_simple() this way ensuring proper alignment
of the returned memory block.
Fixes: ee038c58d5
("malloc: Use malloc simple before malloc is fully initialized in memalign()")
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
This commit is contained in:
committed by
Tom Rini
parent
443b3ce5cf
commit
4c6be01c27
@@ -878,7 +878,6 @@ extern Void_t* sbrk();
|
||||
#define memalign memalign_simple
|
||||
static inline void free(void *ptr) {}
|
||||
void *calloc(size_t nmemb, size_t size);
|
||||
void *memalign_simple(size_t alignment, size_t bytes);
|
||||
void *realloc_simple(void *ptr, size_t size);
|
||||
void malloc_simple_info(void);
|
||||
#else
|
||||
@@ -914,6 +913,7 @@ int initf_malloc(void);
|
||||
|
||||
/* Simple versions which can be used when space is tight */
|
||||
void *malloc_simple(size_t size);
|
||||
void *memalign_simple(size_t alignment, size_t bytes);
|
||||
|
||||
#pragma GCC visibility push(hidden)
|
||||
# if __STD_C
|
||||
|
Reference in New Issue
Block a user