From: Nick Piggin Date: Tue, 16 Jun 2009 22:32:38 +0000 (-0700) Subject: mm: madvise(): correct return code X-Git-Tag: v2.6.31-rc1~299^2~113 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75927af8bcb940dad4fe281713d526cb520869ff;p=pandora-kernel.git mm: madvise(): correct return code The posix_madvise() function succeeds (and does nothing) when called with parameters (NULL, 0, -1); according to LSB tests, it should fail with EINVAL because -1 is not a valid flag. When called with a valid address and size, it correctly fails. So perform an initial check for valid flags first. Reported-by: Jiri Dluhos Signed-off-by: Nick Piggin Reviewed-and-Tested-by: WANG Cong Cc: Michael Kerrisk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed