Commit 89b6c8d1 authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Mason

Btrfs: tests: checking for NULL instead of IS_ERR()

btrfs_alloc_dummy_root() return an error pointer on failure, it never
returns NULL.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 9dcbeed4
......@@ -898,8 +898,10 @@ int btrfs_test_free_space_cache(void)
}
root = btrfs_alloc_dummy_root();
if (!root)
if (IS_ERR(root)) {
ret = PTR_ERR(root);
goto out;
}
root->fs_info = btrfs_alloc_dummy_fs_info();
if (!root->fs_info)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment