diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-12-03 14:24:58 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-12-13 14:09:24 +0100 |
commit | b6293c821ea8fa2a631a2112cd86cd435effeb8b (patch) | |
tree | 840530ae59948efe66243b6b212f2a3ba90104ae /fs/btrfs/tests/free-space-tree-tests.c | |
parent | cf93e15eca0bcb457b6a85b3480c1e379407dd26 (diff) | |
download | linux-b6293c821ea8fa2a631a2112cd86cd435effeb8b.tar.bz2 |
btrfs: return error pointer from alloc_test_extent_buffer
Callers of alloc_test_extent_buffer have not correctly interpreted the
return value as error pointer, as alloc_test_extent_buffer should behave
as alloc_extent_buffer. The self-tests were unaffected but
btrfs_find_create_tree_block could call both functions and that would
cause problems up in the call chain.
Fixes: faa2dbf004e8 ("Btrfs: add sanity tests for new qgroup accounting code")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tests/free-space-tree-tests.c')
-rw-r--r-- | fs/btrfs/tests/free-space-tree-tests.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/tests/free-space-tree-tests.c b/fs/btrfs/tests/free-space-tree-tests.c index 1a846bf6e197..914eea5ba6a7 100644 --- a/fs/btrfs/tests/free-space-tree-tests.c +++ b/fs/btrfs/tests/free-space-tree-tests.c @@ -452,9 +452,9 @@ static int run_test(test_func_t test_func, int bitmaps, u32 sectorsize, root->fs_info->tree_root = root; root->node = alloc_test_extent_buffer(root->fs_info, nodesize); - if (!root->node) { + if (IS_ERR(root->node)) { test_std_err(TEST_ALLOC_EXTENT_BUFFER); - ret = -ENOMEM; + ret = PTR_ERR(root->node); goto out; } btrfs_set_header_level(root->node, 0); |