frv: fix mmap2 error handling
authorDavid Howells <dhowells@redhat.com>
Mon, 1 Dec 2008 21:14:00 +0000 (13:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Dec 2008 03:55:24 +0000 (19:55 -0800)
commitf3742971c1f783f0683d187be5ef5fe53e492e57
treed4ba29d8a61958e0e039d144734c883e50232e15
parent9c8d813565ff9a85425c0031505614ffe8c77681
frv: fix mmap2 error handling

Fix the error handling in sys_mmap2().  Currently, if the pgoff check
fails, fput() might have to be called (which it isn't), so do the pgoff
check first, before fget() is called.

Signed-off-by: David Howells <dhowells@redhat.com>
Reported-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/frv/kernel/sys_frv.c