public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] btrfs: tests: Fix double free in remove_extent_ref()
@ 2025-11-27  7:14 Dan Carpenter
  2025-11-27 17:29 ` David Sterba
  2025-11-28  4:11 ` Sun Yangkai
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-11-27  7:14 UTC (permalink / raw)
  To: Sun YangKai
  Cc: Chris Mason, David Sterba, linux-btrfs, linux-kernel,
	kernel-janitors

We converted this code to use auto free cleanup.h magic but one old
school free was accidentally left behind which leads to a double free
bug.

Fixes: a320476ca8a3 ("btrfs: tests: do trivial BTRFS_PATH_AUTO_FREE conversions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 fs/btrfs/tests/qgroup-tests.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/btrfs/tests/qgroup-tests.c b/fs/btrfs/tests/qgroup-tests.c
index 05cfda8af422..e9124605974b 100644
--- a/fs/btrfs/tests/qgroup-tests.c
+++ b/fs/btrfs/tests/qgroup-tests.c
@@ -187,7 +187,6 @@ static int remove_extent_ref(struct btrfs_root *root, u64 bytenr,
 	ret = btrfs_search_slot(&trans, root, &key, path, -1, 1);
 	if (ret) {
 		test_err("couldn't find backref %d", ret);
-		btrfs_free_path(path);
 		return ret;
 	}
 	btrfs_del_item(&trans, root, path);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-28  4:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-27  7:14 [PATCH next] btrfs: tests: Fix double free in remove_extent_ref() Dan Carpenter
2025-11-27 17:29 ` David Sterba
2025-11-28  4:11 ` Sun Yangkai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox