Commit cfd1d0f5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Dominique Martinet

9p: Remove unnecessary IS_ERR() check

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
parent dfd37586
...@@ -56,12 +56,11 @@ static struct p9_fid *v9fs_fid_find_inode(struct inode *inode, kuid_t uid) ...@@ -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; h = (struct hlist_head *)&inode->i_private;
hlist_for_each_entry(fid, h, ilist) { hlist_for_each_entry(fid, h, ilist) {
if (uid_eq(fid->uid, uid)) { if (uid_eq(fid->uid, uid)) {
refcount_inc(&fid->count);
ret = fid; ret = fid;
break; break;
} }
} }
if (ret && !IS_ERR(ret))
refcount_inc(&ret->count);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment