]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mremap: check for overflow using deltas
authorAndrea Arcangeli <aarcange@redhat.com>
Wed, 28 Sep 2011 00:50:13 +0000 (10:50 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 30 Sep 2011 04:53:24 +0000 (14:53 +1000)
commit2a40dc6667f19a50c7d867d7f1e6eb1d29b78760
treee74d997e3afe64f9559dc4bcca1cb4fbdece568a
parentf0b6c8c2ad6063550d2b33efef30640c007976b0
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 <>
mm/mremap.c