tlsf_malloc: return valid pointer for malloc(0)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
cac75c0f23
commit
e652753f95
|
@ -33,6 +33,13 @@ extern tlsf_pool tlsf_mem_pool;
|
|||
|
||||
void *malloc(size_t bytes)
|
||||
{
|
||||
/*
|
||||
* tlsf_malloc returns NULL for zero bytes, we instead want
|
||||
* to have a valid pointer.
|
||||
*/
|
||||
if (!bytes)
|
||||
bytes = 1;
|
||||
|
||||
return tlsf_malloc(tlsf_mem_pool, bytes);
|
||||
}
|
||||
EXPORT_SYMBOL(malloc);
|
||||
|
|
Loading…
Reference in New Issue