diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-11-10 10:10:03 +0100 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-11-25 14:19:50 +0100 |
commit | 89b6c8d1e4a178a347b94f339b959f02710e7060 (patch) | |
tree | 77bcfcb9063302849cdb3d5be95718585e52ba1d /fs/btrfs/tests | |
parent | btrfs: fix signed overflows in btrfs_sync_file (diff) | |
download | linux-89b6c8d1e4a178a347b94f339b959f02710e7060.tar.xz linux-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 'fs/btrfs/tests')
-rw-r--r-- | fs/btrfs/tests/free-space-tests.c | 4 |
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) |