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: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
Dan Carpenter 2015-11-10 12:10:03 +03:00 committed by Chris Mason
parent 9dcbeed4d7
commit 89b6c8d1e4
1 changed files with 3 additions and 1 deletions

View File

@ -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)