malloc_simple: Correct the alignment logic in memalign_simple()
PATCH 1/1 malloc_simple: Correct the alignment logic in memalign_simple()
This should use the align parameter, not bytes. Natural alignment is one use case but should not be the only one supported by this function.
Signed-off-by Simon Glass <[email protected]>
---
common/malloc_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/malloc_simple.c +1 -1
@@ -31,7 +31,7 @@ void *memalign_simple(size_t align, size_t bytes)ulong addr, new_ptr;void *ptr; - addr =ALIGN (gd->malloc_base + gd->malloc_ptr, bytes); + addr =ALIGN (gd->malloc_base + gd->malloc_ptr, align); new_ptr = addr + bytes;if (new_ptr > gd->malloc_limit)return NULL ;
Signature · 1 line
2.5.0.276.gf5e568e
PATCH 1/1 malloc_simple: Correct the alignment logic in memalign_simple()
Quoted 4 lines · Simon Glass
This should use the align parameter, not bytes. Natural alignment is one use case but should not be the only one supported by this function.
Signed-off-by Simon Glass <[email protected]>
Reviewed-by Tom Rini <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150814/bc54027d/attachment.sig>
Quoted 5 lines · Simon Glass
This should use the align parameter, not bytes. Natural alignment is one use case but should not be the only one supported by this function.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150828/f981789b/attachment.sig>