]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mremap: check for overflow using deltas
authorAndrea Arcangeli <aarcange@redhat.com>
Wed, 5 Oct 2011 00:43:00 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 12 Oct 2011 06:32:06 +0000 (17:32 +1100)
commitc32890682eb89435e2281d15b39850908694d88e
tree38163325138fbd0f54184dd37daa171d09217c8b
parent2c2d8cef75bf8412068e21b3a07f4ae97d2fb729
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>
mm/mremap.c