Skip to content

Commit 1eae9a4

Browse files
author
Al Viro
committed
/proc/sys: use d_splice_alias() calling conventions to simplify failure exits
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 6f36230 commit 1eae9a4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

fs/proc/proc_sysctl.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,8 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
534534
goto out;
535535
}
536536

537-
inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p);
538-
if (IS_ERR(inode)) {
539-
err = ERR_CAST(inode);
540-
goto out;
541-
}
542-
543537
d_set_d_op(dentry, &proc_sys_dentry_operations);
538+
inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p);
544539
err = d_splice_alias(inode, dentry);
545540

546541
out:
@@ -698,13 +693,8 @@ static bool proc_sys_fill_cache(struct file *file,
698693
return false;
699694
if (d_in_lookup(child)) {
700695
struct dentry *res;
701-
inode = proc_sys_make_inode(dir->d_sb, head, table);
702-
if (IS_ERR(inode)) {
703-
d_lookup_done(child);
704-
dput(child);
705-
return false;
706-
}
707696
d_set_d_op(child, &proc_sys_dentry_operations);
697+
inode = proc_sys_make_inode(dir->d_sb, head, table);
708698
res = d_splice_alias(inode, child);
709699
d_lookup_done(child);
710700
if (unlikely(res)) {

0 commit comments

Comments
 (0)