fs/btrfs/tests/qgroup-tests.c | 1 - 1 file changed, 1 deletion(-)
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
Thanks. My bad.
在 2025/11/27 15:14, Dan Carpenter 写道:
> 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);
On Thu, Nov 27, 2025 at 10:14:24AM +0300, Dan Carpenter wrote:
> 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>
Thanks, I'll add it to for-next as 6.19 branch is frozen.
© 2016 - 2025 Red Hat, Inc.