]> git.ipfire.org Git - thirdparty/u-boot.git/commit
sandbox: Correct maths in allocation routines
authorSimon Glass <sjg@chromium.org>
Mon, 8 Apr 2019 19:20:42 +0000 (13:20 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Apr 2019 02:26:43 +0000 (20:26 -0600)
commit4a6409b74cc09b150f234ba3ab7d75ba6358270a
tree5c51b5c43a11bc53075017432adc41a142bd21a4
parent001d1885f0012dbedef44bd828f91ba048029261
sandbox: Correct maths in allocation routines

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@chromium.org>
arch/sandbox/cpu/os.c