Btrfs: tests: checking for NULL instead of IS_ERR()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
fs/btrfs/tests/free-space-tests.c +3 -1
@@ -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)
Quoted 4 lines · Dan Carpenter
btrfs_alloc_dummy_root()return an error pointer on failure, it never returns NULL.Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by David Sterba <[email protected]>