]> 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>
Tue, 4 Oct 2011 07:38:33 +0000 (18:38 +1100)
commitf7737123d9b8a60b7ec5deb78c265c4b6bb53c96
treef12a3f384cf43e392d79496ce60f1e67362dc059
parent17a19526e540dec1acbee3ce745ac71eb4b3ee60
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