Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clean erofs_lookup()

d_splice_alias() does the right thing when given
ERR_PTR(-E...) for inode. No need for gotos, multiple
returns, etc. in there.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 8300807f 5b394b2d

+7 -12
+7 -12
drivers/staging/erofs/namei.c
··· 223 223 if (err == -ENOENT) { 224 224 /* negative dentry */ 225 225 inode = NULL; 226 - goto negative_out; 227 - } else if (unlikely(err)) 228 - return ERR_PTR(err); 229 - 230 - debugln("%s, %s (nid %llu) found, d_type %u", __func__, 231 - dentry->d_name.name, nid, d_type); 232 - 233 - inode = erofs_iget(dir->i_sb, nid, d_type == EROFS_FT_DIR); 234 - if (IS_ERR(inode)) 235 - return ERR_CAST(inode); 236 - 237 - negative_out: 226 + } else if (unlikely(err)) { 227 + inode = ERR_PTR(err); 228 + } else { 229 + debugln("%s, %s (nid %llu) found, d_type %u", __func__, 230 + dentry->d_name.name, nid, d_type); 231 + inode = erofs_iget(dir->i_sb, nid, d_type == EROFS_FT_DIR); 232 + } 238 233 return d_splice_alias(inode, dentry); 239 234 } 240 235