aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tests/free-space-tests.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-11-10 12:10:03 +0300
committerChris Mason <clm@fb.com>2015-11-25 05:19:50 -0800
commit89b6c8d1e4a178a347b94f339b959f02710e7060 (patch)
tree77bcfcb9063302849cdb3d5be95718585e52ba1d /fs/btrfs/tests/free-space-tests.c
parentbtrfs: fix signed overflows in btrfs_sync_file (diff)
downloadlinux-dev-89b6c8d1e4a178a347b94f339b959f02710e7060.tar.xz
linux-dev-89b6c8d1e4a178a347b94f339b959f02710e7060.zip
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>
Diffstat (limited to '')
-rw-r--r--fs/btrfs/tests/free-space-tests.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/tests/free-space-tests.c b/fs/btrfs/tests/free-space-tests.c
index c8c3d70c31ff..8b72b005bfb9 100644
--- a/fs/btrfs/tests/free-space-tests.c
+++ b/fs/btrfs/tests/free-space-tests.c
@@ -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)