]> 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>
Thu, 29 Sep 2011 06:08:06 +0000 (16:08 +1000)
commit16fde7fb0cf52e5096892d45e794fcad500da462
treed059ab371bee1f00072511eeb15cf243a0821f9d
parentcf4a9d4a1f593051e973efb1e215868ddb3a618e
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