VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   57 Tags
author: Dan Carpenter <dan.carpenter@oracle.com> 2020-12-01 10:04:34 +0300 committer: Dominique Martinet <asmadeus@codewreck.org> 2020-12-01 08:19:02 +0100 commit: cfd1d0f524a87b7d6d14b41a14fa4cbe522cf8cc parent: dfd375864ac1e2ee60ed2d61820697ac01642f80
Commit Summary:
9p: Remove unnecessary IS_ERR() check
Diffstat:
1 file changed, 1 insertion, 2 deletions
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 79837f1b1c91..9d9de62592be 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -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;
 }