diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2023-11-11 01:13:08 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2023-12-21 12:51:01 -0500 |
commit | 1eae9a47835ed4703055afbb3c52fef6d07a8a4c (patch) | |
tree | 0f4250cf1c337429461133c0c3769ab46bf8a884 /fs/proc | |
parent | 6f36230e235da4f34a831d20c51f0472e1a36f48 (diff) | |
download | linux-1eae9a47835ed4703055afbb3c52fef6d07a8a4c.tar.gz linux-1eae9a47835ed4703055afbb3c52fef6d07a8a4c.tar.bz2 linux-1eae9a47835ed4703055afbb3c52fef6d07a8a4c.zip |
/proc/sys: use d_splice_alias() calling conventions to simplify failure exits
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/proc_sysctl.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 8064ea76f80b..1ae6486dc7d4 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -534,13 +534,8 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, goto out; } - inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); - if (IS_ERR(inode)) { - err = ERR_CAST(inode); - goto out; - } - d_set_d_op(dentry, &proc_sys_dentry_operations); + inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); err = d_splice_alias(inode, dentry); out: @@ -698,13 +693,8 @@ static bool proc_sys_fill_cache(struct file *file, return false; if (d_in_lookup(child)) { struct dentry *res; - inode = proc_sys_make_inode(dir->d_sb, head, table); - if (IS_ERR(inode)) { - d_lookup_done(child); - dput(child); - return false; - } d_set_d_op(child, &proc_sys_dentry_operations); + inode = proc_sys_make_inode(dir->d_sb, head, table); res = d_splice_alias(inode, child); d_lookup_done(child); if (unlikely(res)) { |