aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/inode.c19
-rw-r--r--fs/proc/proc_tty.c1
2 files changed, 3 insertions, 17 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index e11dc22c6511..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);
@@ -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
494out_ino:
495 module_put(de->owner);
496out_mod:
497 return NULL;
498} 485}
499 486
500int proc_fill_super(struct super_block *s) 487int proc_fill_super(struct super_block *s)
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index d153946d6d15..4a9e0f65ae60 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -152,7 +152,6 @@ void proc_tty_register_driver(struct tty_driver *driver)
152 if (!ent) 152 if (!ent)
153 return; 153 return;
154 ent->read_proc = driver->ops->read_proc; 154 ent->read_proc = driver->ops->read_proc;
155 ent->owner = driver->owner;
156 ent->data = driver; 155 ent->data = driver;
157 156
158 driver->proc_entry = ent; 157 driver->proc_entry = ent;