diff options
author | Nick Piggin <npiggin@suse.de> | 2009-06-17 00:32:38 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-17 04:47:40 +0200 |
commit | 75927af8bcb940dad4fe281713d526cb520869ff (patch) | |
tree | 96b2b903ce215d3c47204b7b77724c9fa0aa6502 /Documentation/i2c/smbus-protocol | |
parent | page-allocator: warn if __GFP_NOFAIL is used for a large allocation (diff) | |
download | linux-75927af8bcb940dad4fe281713d526cb520869ff.tar.xz linux-75927af8bcb940dad4fe281713d526cb520869ff.zip |
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 <jdluhos@novell.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Reviewed-and-Tested-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/i2c/smbus-protocol')
0 files changed, 0 insertions, 0 deletions