diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-02-12 21:56:08 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:34 -0400 |
commit | 6b4231e2f92adbcf96fb2a3fa751d7ca0a61b21f (patch) | |
tree | e4ede05b2253e6bc333b007b2550bd9503e0a98f | |
parent | be0d93f0aa5682a24a2a9ec0dd26fffaad608cce (diff) |
procfs: clean proc_fill_super() up
First of all, there's no need to zero ->i_uid/->i_gid on root inode -
both had been set to zero already. Moreover, let's take the iput()
on failure to the failure exit it belongs to...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/proc/inode.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 84fd3235a590..a70af3a44f45 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -499,16 +499,15 @@ int proc_fill_super(struct super_block *s) | |||
499 | root_inode = proc_get_inode(s, &proc_root); | 499 | root_inode = proc_get_inode(s, &proc_root); |
500 | if (!root_inode) | 500 | if (!root_inode) |
501 | goto out_no_root; | 501 | goto out_no_root; |
502 | root_inode->i_uid = 0; | ||
503 | root_inode->i_gid = 0; | ||
504 | s->s_root = d_alloc_root(root_inode); | 502 | s->s_root = d_alloc_root(root_inode); |
505 | if (!s->s_root) | 503 | if (!s->s_root) { |
504 | iput(root_inode); | ||
506 | goto out_no_root; | 505 | goto out_no_root; |
506 | } | ||
507 | return 0; | 507 | return 0; |
508 | 508 | ||
509 | out_no_root: | 509 | out_no_root: |
510 | printk("proc_read_super: get root inode failed\n"); | 510 | printk("proc_read_super: get root inode failed\n"); |
511 | iput(root_inode); | ||
512 | pde_put(&proc_root); | 511 | pde_put(&proc_root); |
513 | return -ENOMEM; | 512 | return -ENOMEM; |
514 | } | 513 | } |