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:
3fa8749
)
proc: fix return value of proc_reg_open() in "too late" case
author
Alexey Dobriyan
<adobriyan@gmail.com>
Thu, 2 Oct 2008 20:18:52 +0000
(
00:18
+0400)
committer
Alexey Dobriyan
<adobriyan@gmail.com>
Fri, 10 Oct 2008 00:18:54 +0000
(
04:18
+0400)
If ->open() wasn't called, returning 0 is misleading and, theoretically,
oopsable:
1) remove_proc_entry clears ->proc_fops, drops lock,
2) ->open "succeeds",
3) ->release oopses, because it assumes ->open was called (single_release()).
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
fs/proc/inode.c
patch
|
blob
|
history
diff --git
a/fs/proc/inode.c
b/fs/proc/inode.c
index 8bb03f056c282ec1c0b4b256c5f4ed4551182f1c..c6b4fa7e3b49e9a2625bf3a76465c85d7df7eba2 100644
(file)
--- a/
fs/proc/inode.c
+++ b/
fs/proc/inode.c
@@
-342,7
+342,7
@@
static int proc_reg_open(struct inode *inode, struct file *file)
if (!pde->proc_fops) {
spin_unlock(&pde->pde_unload_lock);
kfree(pdeo);
- return
rv
;
+ return
-EINVAL
;
}
pde->pde_users++;
open = pde->proc_fops->open;