diff mbox series

xfs: fix a memory leak

Message ID 20240724051155.GX612460@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series xfs: fix a memory leak | expand

Commit Message

Darrick J. Wong July 24, 2024, 5:11 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

kmemleak reported that we don't free the parent pointer names here if we
found corruption.

Fixes: 0d29a20fbdba8 ("xfs: scrub parent pointers")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 fs/xfs/scrub/parent.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig July 24, 2024, 1:15 p.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
index 9de1483b04d6d..3b692c4acc1e6 100644
--- a/fs/xfs/scrub/parent.c
+++ b/fs/xfs/scrub/parent.c
@@ -821,7 +821,7 @@  xchk_parent_pptr(
 	}
 
 	if (pp->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
-		goto out_pp;
+		goto out_names;
 
 	/*
 	 * Complain if the number of parent pointers doesn't match the link