
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 -------------------------------- 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: Yongqiang Liu <liuyongqiang13@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 ff298a9baa0a..26bd2004fe35 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -494,9 +494,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) { @@ -520,7 +519,6 @@ static struct dentry * configfs_lookup(struct inode *dir, return NULL; } -out: return ERR_PTR(err); } -- 2.25.1