From: Christoph Hellwig hch@lst.de
mainline inclusion from mainline-v5.15-rc1 commit 899587c8d0908e5124fd074d52bf05b4b0633a79 category: bugfix bugzilla: 187567, https://gitee.com/openeuler/kernel/issues/I5PK1G CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs...
--------------------------------
Return the error directly instead of using a goto.
Signed-off-by: Christoph Hellwig hch@lst.de Signed-off-by: Zhihao Cheng chengzhihao1@huawei.com Reviewed-by: Zhang Yi yi.zhang@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- fs/configfs/dir.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index e28ab91d973d..59c5a1519386 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -476,9 +476,8 @@ static struct dentry * configfs_lookup(struct inode *dir, * not complete their initialization, since the dentries of the * attributes won't be instantiated. */ - err = -ENOENT; if (!configfs_dirent_is_ready(parent_sd)) - goto out; + return ERR_PTR(-ENOENT);
list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { if (sd->s_type & CONFIGFS_NOT_PINNED) { @@ -502,7 +501,6 @@ static struct dentry * configfs_lookup(struct inode *dir, return NULL; }
-out: return ERR_PTR(err); }