]> www.infradead.org Git - users/hch/misc.git/commitdiff
xfs: fix error bailout in xfs_rtginode_create
authorDarrick J. Wong <djwong@kernel.org>
Mon, 2 Dec 2024 18:57:30 +0000 (10:57 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 13 Dec 2024 01:45:10 +0000 (17:45 -0800)
smatch reported that we screwed up the error cleanup in this function.
Fix it.

Cc: <stable@vger.kernel.org> # v6.13-rc1
Fixes: ae897e0bed0f54 ("xfs: support creating per-RTG files in growfs")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_rtgroup.c

index e74bb059f24fa1117a2395ffb5d08483052d43ee..4f3bfc884aff29ab9c4627abfc565681233b1bcc 100644 (file)
@@ -496,7 +496,7 @@ xfs_rtginode_create(
 
        error = xfs_metadir_create(&upd, S_IFREG);
        if (error)
-               return error;
+               goto out_cancel;
 
        xfs_rtginode_lockdep_setup(upd.ip, rtg_rgno(rtg), type);