summaryrefslogtreecommitdiff
path: root/fs/proc/task_mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r--fs/proc/task_mmu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 9bd8be1d235c..07376a4a3ed1 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -689,8 +689,6 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
down_read(&current->mm->mmap_sem);
ret = get_user_pages(current, current->mm, uaddr, pagecount,
1, 0, pages, NULL);
- up_read(&current->mm->mmap_sem);
-
if (ret < 0)
goto out_free;
@@ -739,6 +737,7 @@ out_pages:
page_cache_release(page);
}
out_free:
+ up_read(&current->mm->mmap_sem);
kfree(pages);
out_mm:
mmput(mm);