lib/memalign: don't malloc size twice
authorTomohiro Kusumi <tkusumi@tuxera.com>
Mon, 18 Sep 2017 17:53:49 +0000 (20:53 +0300)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Sep 2017 18:04:36 +0000 (12:04 -0600)
commitba8b89a1549c5ce7d7544813c9137798de454fac
treef12f36fe575ea7454f963868aed19b6b7ad1c5a6
parent9acb08a9957b1111a06fbca6af113fa0c98dbd7c
lib/memalign: don't malloc size twice

The footer offset (diff between malloc'd address and aligned address)
is (alignment-1) at most, and footer appears `size' bytes after the
aligned address, thus required size is (alignment-1 + size + sizeof(*f)).

The existing code seems to allocate extra unused `size' bytes.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
lib/memalign.c