Skip to content

Commit

Permalink
9p: Remove unnecessary IS_ERR() check
Browse files Browse the repository at this point in the history
The "fid" variable can't be an error pointer so there is no need to
check.  The code is slightly cleaner if we move the increment before
the break and remove the NULL check as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
  • Loading branch information
Dan Carpenter authored and martinetd committed Dec 1, 2020
1 parent dfd3758 commit cfd1d0f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/9p/fid.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ static struct p9_fid *v9fs_fid_find_inode(struct inode *inode, kuid_t uid)
h = (struct hlist_head *)&inode->i_private;
hlist_for_each_entry(fid, h, ilist) {
if (uid_eq(fid->uid, uid)) {
refcount_inc(&fid->count);
ret = fid;
break;
}
}
if (ret && !IS_ERR(ret))
refcount_inc(&ret->count);
spin_unlock(&inode->i_lock);
return ret;
}
Expand Down

0 comments on commit cfd1d0f

Please sign in to comment.