VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Damien Le Moal <damien.lemoal@wdc.com> 2020-07-20 17:52:52 +0900 committer: Damien Le Moal <damien.lemoal@wdc.com> 2020-07-20 17:57:50 +0900 commit: 01b2651cfb20ba38429cdb47c68f36e56a2d3cb4 parent: 5714ee50bb4375bd586858ad800b1d9772847452
Commit Summary:
zonefs: Fix compilation warning
Diffstat:
1 file changed, 7 insertions, 3 deletions
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 07bc42d62673..e419833107b2 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -1119,7 +1119,7 @@ static int zonefs_create_zgroup(struct zonefs_zone_data *zd,
 	char *file_name;
 	struct dentry *dir;
 	unsigned int n = 0;
-	int ret = -ENOMEM;
+	int ret;
 
 	/* If the group is empty, there is nothing to do */
 	if (!zd->nr_zones[type])
@@ -1135,8 +1135,10 @@ static int zonefs_create_zgroup(struct zonefs_zone_data *zd,
 		zgroup_name = "seq";
 
 	dir = zonefs_create_inode(sb->s_root, zgroup_name, NULL, type);
-	if (!dir)
+	if (!dir) {
+		ret = -ENOMEM;
 		goto free;
+	}
 
 	/*
 	 * The first zone contains the super block: skip it.
@@ -1174,8 +1176,10 @@ static int zonefs_create_zgroup(struct zonefs_zone_data *zd,
 		 * Use the file number within its group as file name.
 		 */
 		snprintf(file_name, ZONEFS_NAME_MAX - 1, "%u", n);
-		if (!zonefs_create_inode(dir, file_name, zone, type))
+		if (!zonefs_create_inode(dir, file_name, zone, type)) {
+			ret = -ENOMEM;
 			goto free;
+		}
 
 		n++;
 	}