Skip to content

Commit

Permalink
Btrfs: checking for NULL instead of IS_ERR
Browse files Browse the repository at this point in the history
add_qgroup_rb() never returns NULL, only error pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
  • Loading branch information
Dan Carpenter authored and Chris Mason committed Aug 28, 2012
1 parent 5986802 commit 57a5a88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 57a5a88

Please sign in to comment.