[U-Boot] [PATCH v2 02/13] sandbox: Correct maths in allocation routines

sjg at google.com sjg at google.com
Mon Apr 22 02:38:44 UTC 2019

Allocation routines were adjusted to ensure that the returned addresses
are a multiple of the page size, but the header code was not updated to
take account of this. These routines assume that the header size is the
same as the page size which is unlikely.

At present os_realloc() does not work correctly due to this bug. The only
user is the hostfs 'ls' command, and only if the directory contains a
unusually long filename, which likely explains why this bug was not
caught earlier.

Fix this by doing the calculations using the obtained page size.

Signed-off-by: Simon Glass <sjg at chromium.org>

Changes in v2:
- Add a new patch to Correct maths in allocation routines

 arch/sandbox/cpu/os.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

Applied to u-boot-dm, thanks!

More information about the U-Boot mailing list