mremap: check for overflow using deltas
authorAndrea Arcangeli <aarcange@redhat.com>
Tue, 1 Nov 2011 00:08:22 +0000 (17:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Nov 2011 00:30:47 +0000 (17:30 -0700)
commitebed48460be5abd86d9a24fa7c66378e58109f30
tree721d935953c58ac014e3d00ea1092ab480ea3356
parent6661672053aee709d93f5dbd7887c789364c11d4
mremap: check for overflow using deltas

Using "- 1" relies on the old_end to be page aligned and PAGE_SIZE > 1,
those are reasonable requirements but the check remains obscure and it
looks more like an off by one error than an overflow check.  This I feel
will improve readability.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Johannes Weiner <jweiner@redhat.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mremap.c
This page took 0.023936 seconds and 5 git commands to generate.