get_user_pages(): fix possible page leak on oom
authorOleg Nesterov <oleg@tv-sign.ru>
Fri, 4 Jul 2008 16:59:28 +0000 (09:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 4 Jul 2008 17:40:04 +0000 (10:40 -0700)
commit7a36a752d006f6874049da510297eeb7f09d92a7
tree764d02c44b95e34deb9cd3ed9d7bdc03c35ef172
parent7ca796f492a11f9408e661c8f22cd8c4f486b8e5
get_user_pages(): fix possible page leak on oom

get_user_pages() must not return the error when i != 0.  When pages !=
NULL we have i get_page()'ed pages.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c