Btrfs: checking for NULL instead of IS_ERR
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 30 Jul 2012 08:15:43 +0000 (02:15 -0600)
committerChris Mason <chris.mason@oracle.com>
Tue, 28 Aug 2012 20:53:25 +0000 (16:53 -0400)
add_qgroup_rb() never returns NULL, only error pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
fs/btrfs/qgroup.c

index 229ef8927e6b809d58efe942fa05920d3cca624f..38b42e7bc91d0e258a7fd086d793aae3d43ac4c1 100644 (file)
@@ -1364,8 +1364,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
        spin_lock(&fs_info->qgroup_lock);
 
        dstgroup = add_qgroup_rb(fs_info, objectid);
-       if (!dstgroup)
+       if (IS_ERR(dstgroup)) {
+               ret = PTR_ERR(dstgroup);
                goto unlock;
+       }
 
        if (srcid) {
                srcgroup = find_qgroup_rb(fs_info, srcid);