mm/madvise: move up the behavior parameter validation
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>
Wed, 3 May 2017 21:55:28 +0000 (14:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 May 2017 22:52:11 +0000 (15:52 -0700)
commit5e451be75ca51dd45a77a6409a30a0de39dc15c8
treeadcd585bd3b2417ac96afddfd3b8aebfbd5cce4a
parent97167a7681e9a587ee75955bcbbf27e90f0883b9
mm/madvise: move up the behavior parameter validation

madvise_behavior_valid() should be called before acting upon the
behavior parameter.  Hence move up the function.  This also includes
MADV_SOFT_OFFLINE and MADV_HWPOISON options as valid behavior parameter
for the system call madvise().

Link: http://lkml.kernel.org/r/20170418052844.24891-1-khandual@linux.vnet.ibm.com
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/madvise.c