]> 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>
Thu, 6 Oct 2011 05:59:42 +0000 (16:59 +1100)
commit88587d42549d91f5e4c7d2c3b6bffa53a7581e2c
tree016600e8f9aed979fec837dd831aaf0eb49810c7
parent6fe51f86d50209c02699e583904984ab50c97c60
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