Browse Source

Btrfs: checking for NULL instead of IS_ERR

add_qgroup_rb() never returns NULL, only error pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Dan Carpenter 13 năm trước cách đây
mục cha
commit
57a5a88203
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      fs/btrfs/qgroup.c

+ 3 - 1
fs/btrfs/qgroup.c

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