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:
0db0c01
)
procfs: fix some wrong error code usage
author
Jovi Zhang
<
[email protected]
>
Wed, 23 Mar 2011 23:42:51 +0000
(16:42 -0700)
committer
Linus Torvalds
<
[email protected]
>
Thu, 24 Mar 2011 02:46:36 +0000
(19:46 -0700)
[root@wei 1]# cat /proc/1/mem
cat: /proc/1/mem: No such process
error code -ESRCH is wrong in this situation. Return -EPERM instead.
Signed-off-by: Jovi Zhang <
[email protected]
>
Reviewed-by: KOSAKI Motohiro <
[email protected]
>
Cc: Alexey Dobriyan <
[email protected]
>
Cc: Al Viro <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/proc/base.c
patch
|
blob
|
history
diff --git
a/fs/proc/base.c
b/fs/proc/base.c
index c3af15e9c070d5a2d4501e2fab89dd0321754953..daba13653256ae1f571e6577445e6e0fb19d8fee 100644
(file)
--- a/
fs/proc/base.c
+++ b/
fs/proc/base.c
@@
-775,7
+775,8
@@
static ssize_t mem_read(struct file * file, char __user * buf,
if (!task)
goto out_no_task;
- if (check_mem_permission(task))
+ ret = check_mem_permission(task);
+ if (ret)
goto out;
ret = -ENOMEM;
@@
-845,7
+846,8
@@
static ssize_t mem_write(struct file * file, const char __user *buf,
if (!task)
goto out_no_task;
- if (check_mem_permission(task))
+ copied = check_mem_permission(task);
+ if (copied)
goto out;
copied = -ENOMEM;
@@
-917,6
+919,7
@@
static ssize_t environ_read(struct file *file, char __user *buf,
if (!task)
goto out_no_task;
+ ret = -EPERM;
if (!ptrace_may_access(task, PTRACE_MODE_READ))
goto out;