projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ca796f
)
get_user_pages(): fix possible page leak on oom
author
Oleg Nesterov
<
[email protected]
>
Fri, 4 Jul 2008 16:59:28 +0000
(09:59 -0700)
committer
Linus Torvalds
<
[email protected]
>
Fri, 4 Jul 2008 17:40:04 +0000
(10:40 -0700)
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 <
[email protected]
>
Acked-by: Nick Piggin <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/memory.c
patch
|
blob
|
history
diff --git
a/mm/memory.c
b/mm/memory.c
index 350e646032f52ddaefa5c5ee44efa2376261f382..2302d228fe04f3926f8c52bf65965623f1caff05 100644
(file)
--- a/
mm/memory.c
+++ b/
mm/memory.c
@@
-1151,7
+1151,7
@@
int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
* be processed until returning to user space.
*/
if (unlikely(test_tsk_thread_flag(tsk, TIF_MEMDIE)))
- return -ENOMEM;
+ return
i ? i :
-ENOMEM;
if (write)
foll_flags |= FOLL_WRITE;