Commit 5d28738d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Zheng Zengkai
Browse files

configfs: simplify the configfs_dirent_is_ready

mainline inclusion
from mainline-v5.15-rc1
commit 899587c8
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/configfs/dir.c?h=v6.0-rc3&id=899587c8d0908e5124fd074d52bf05b4b0633a79



--------------------------------

Return the error directly instead of using a goto.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent e0dd3005
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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);
}