Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252057
b: refs/heads/master
c: 30cd890
h: refs/heads/master
i:
  252055: 27c2bb1
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed May 27, 2011
1 parent 0cb1e13 commit 8c5b7e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a4dbf0ec2aa3e8aca6e63f598095750c232d50f1
refs/heads/master: 30cd8903913dac7b0918807cac46be3ecde5a5a7
16 changes: 9 additions & 7 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,20 +894,20 @@ static ssize_t mem_write(struct file * file, const char __user *buf,
if (!task)
goto out_no_task;

copied = -ENOMEM;
page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
goto out_task;

mm = check_mem_permission(task);
copied = PTR_ERR(mm);
if (IS_ERR(mm))
goto out_task;
goto out_free;

copied = -EIO;
if (file->private_data != (void *)((long)current->self_exec_id))
goto out_mm;

copied = -ENOMEM;
page = (char *)__get_free_page(GFP_TEMPORARY);
if (!page)
goto out_mm;

copied = 0;
while (count > 0) {
int this_len, retval;
Expand All @@ -929,9 +929,11 @@ static ssize_t mem_write(struct file * file, const char __user *buf,
count -= retval;
}
*ppos = dst;
free_page((unsigned long) page);

out_mm:
mmput(mm);
out_free:
free_page((unsigned long) page);
out_task:
put_task_struct(task);
out_no_task:
Expand Down

0 comments on commit 8c5b7e0

Please sign in to comment.