diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-10-02 10:42:27 +0200 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2013-10-03 10:15:23 +0900 |
commit | 83911ebb61053b3536a7be20793ec76405c23389 (patch) | |
tree | f69835993e2beb85bff2a1429c72b20ccb600607 /include/x86 | |
parent | d26e8b5f2cd9f74cdc4c2ee1be5b22b1eec2f4df (diff) |
kexec: Fix off-by-one errors in locate_hole()
When calling locate_hole() with "hole_size" equal to the size of an
available memory block, it fails to use that memory block.
"end" and "hole_max" point to the last byte within the range, hence
- "size = end - start" is one less than "hole_size",
- "hole_base + hole_size" is one more than "hole_max".
Subtract one from "hole_size" when doing the comparison (adding 1 to "size"
could overflow in case of one big range covering the whole address space).
But explicitly check if "hole_size" is zero first, to handle this case
without causing underflows.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/x86')
0 files changed, 0 insertions, 0 deletions