diff options
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r-- | fs/proc/inode.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index d8bb5c671f42..d78ade305541 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -58,11 +58,8 @@ static void proc_delete_inode(struct inode *inode) | |||
58 | 58 | ||
59 | /* Let go of any associated proc directory entry */ | 59 | /* Let go of any associated proc directory entry */ |
60 | de = PROC_I(inode)->pde; | 60 | de = PROC_I(inode)->pde; |
61 | if (de) { | 61 | if (de) |
62 | if (de->owner) | ||
63 | module_put(de->owner); | ||
64 | de_put(de); | 62 | de_put(de); |
65 | } | ||
66 | if (PROC_I(inode)->sysctl) | 63 | if (PROC_I(inode)->sysctl) |
67 | sysctl_head_put(PROC_I(inode)->sysctl); | 64 | sysctl_head_put(PROC_I(inode)->sysctl); |
68 | clear_inode(inode); | 65 | clear_inode(inode); |
@@ -127,7 +124,7 @@ static void __pde_users_dec(struct proc_dir_entry *pde) | |||
127 | complete(pde->pde_unload_completion); | 124 | complete(pde->pde_unload_completion); |
128 | } | 125 | } |
129 | 126 | ||
130 | static void pde_users_dec(struct proc_dir_entry *pde) | 127 | void pde_users_dec(struct proc_dir_entry *pde) |
131 | { | 128 | { |
132 | spin_lock(&pde->pde_unload_lock); | 129 | spin_lock(&pde->pde_unload_lock); |
133 | __pde_users_dec(pde); | 130 | __pde_users_dec(pde); |
@@ -449,12 +446,9 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino, | |||
449 | { | 446 | { |
450 | struct inode * inode; | 447 | struct inode * inode; |
451 | 448 | ||
452 | if (!try_module_get(de->owner)) | ||
453 | goto out_mod; | ||
454 | |||
455 | inode = iget_locked(sb, ino); | 449 | inode = iget_locked(sb, ino); |
456 | if (!inode) | 450 | if (!inode) |
457 | goto out_ino; | 451 | return NULL; |
458 | if (inode->i_state & I_NEW) { | 452 | if (inode->i_state & I_NEW) { |
459 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 453 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
460 | PROC_I(inode)->fd = 0; | 454 | PROC_I(inode)->fd = 0; |
@@ -485,16 +479,9 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino, | |||
485 | } | 479 | } |
486 | } | 480 | } |
487 | unlock_new_inode(inode); | 481 | unlock_new_inode(inode); |
488 | } else { | 482 | } else |
489 | module_put(de->owner); | ||
490 | de_put(de); | 483 | de_put(de); |
491 | } | ||
492 | return inode; | 484 | return inode; |
493 | |||
494 | out_ino: | ||
495 | module_put(de->owner); | ||
496 | out_mod: | ||
497 | return NULL; | ||
498 | } | 485 | } |
499 | 486 | ||
500 | int proc_fill_super(struct super_block *s) | 487 | int proc_fill_super(struct super_block *s) |