btrfs: tests: Fix double free in remove_extent_ref()
Subsystems (2)
PATCH 1/1 btrfs: tests: Fix double free in remove_extent_ref()
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 <[email protected]>
--- fs/btrfs/tests/qgroup-tests.c | 1 - 1 file changed, 1 deletion(-)
fs/btrfs/tests/qgroup-tests.c +0 -1
@@ -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);
Signature · 1 line
2.51.0
Quoted 6 lines · Dan Carpenter
We converted this code to use auto free
cleanup.hmagic 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 <[email protected]>
Thanks, I'll add it to for-next as 6.19 branch is frozen.
Thanks. My bad.
Quoted 22 lines · Dan Carpenter
We converted this code to use auto free
cleanup.hmagic 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 <[email protected]>--- fs/btrfs/tests/qgroup-tests.c | 1 - 1 file changed, 1 deletion(-)fs/btrfs/tests/qgroup-tests.c +0
-1@@ -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);