diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-03 00:18:52 +0400 |
---|---|---|
committer | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-10 04:18:54 +0400 |
commit | 300b994b74e75120dd1a48529552a44977e0a82a (patch) | |
tree | 5a8cb645c5a10182bbd0bb456285d362bcdd6f51 /fs/proc/inode.c | |
parent | 3fa8749e584b55f1180411ab1b51117190bac1e5 (diff) | |
download | linux-300b994b74e75120dd1a48529552a44977e0a82a.tar.xz |
proc: fix return value of proc_reg_open() in "too late" case
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>
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r-- | fs/proc/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 8bb03f056c28..c6b4fa7e3b49 100644 --- 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; |