]> git.baikalelectronics.ru Git - kernel.git/commit
mremap: check for overflow using deltas
authorAndrea Arcangeli <aarcange@redhat.com>
Tue, 1 Nov 2011 00:08:22 +0000 (17:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 1 Nov 2011 00:30:47 +0000 (17:30 -0700)
commit1b99e28600914574871dcdb0e6e4e80fc50f93eb
tree721d935953c58ac014e3d00ea1092ab480ea3356
parentac0c6a4967e8d18692b4faac7bcd64f1f3bbc347
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mremap.c