]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: fix memory leak in xfs_growfs_check_rtgeom()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 19 Dec 2025 10:33:50 +0000 (13:33 +0300)
committerCarlos Maiolino <cem@kernel.org>
Fri, 9 Jan 2026 11:57:27 +0000 (12:57 +0100)
Free the "nmp" allocation before returning -EINVAL.

Fixes: dc68c0f60169 ("xfs: fix the zoned RT growfs check for zone alignment")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_rtalloc.c

index e063f4f2f2e6175c7583e24d0f8a61efbfb32dcc..167298ad88dde324939e41a5a4139c1e8c47cf6b 100644 (file)
@@ -1265,7 +1265,7 @@ xfs_growfs_check_rtgeom(
                uint32_t        rem;
 
                if (rextsize != 1)
-                       return -EINVAL;
+                       goto out_inval;
                div_u64_rem(nmp->m_sb.sb_rblocks, gblocks, &rem);
                if (rem) {
                        xfs_warn(mp,