Re: [syzbot] [gfs2?] memory leak in gfs2_quota_init (2)

Qing Wang <[email protected]>
Newsgroups dev.linux.lists.gfs2,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
#syz test

diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index f6cd907b3ec6..1144720a17ff 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -149,9 +149,12 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
 	error = gfs2_quota_init(sdp);
 	if (!error && gfs2_withdrawn(sdp))
 		error = -EIO;
-	if (!error)
-		set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
-	return error;
+	if (error) {
+		gfs2_quota_cleanup(sdp);
+		return error;
+	}
+	set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
+	return 0;
 }
 
 void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.