From: Al Viro Date: Mon, 13 Feb 2012 02:56:08 +0000 (-0500) Subject: procfs: clean proc_fill_super() up X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b4231e2f92adbcf96fb2a3fa751d7ca0a61b21f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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) root_inode = proc_get_inode(s, &proc_root); if (!root_inode) goto out_no_root; - root_inode->i_uid = 0; - root_inode->i_gid = 0; s->s_root = d_alloc_root(root_inode); - if (!s->s_root) + if (!s->s_root) { + iput(root_inode); goto out_no_root; + } return 0; out_no_root: printk("proc_read_super: get root inode failed\n"); - iput(root_inode); pde_put(&proc_root); return -ENOMEM; }