[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250310140406.249169-1-i.abramov@mt-integration.ru>
Date: Mon, 10 Mar 2025 17:04:06 +0300
From: Ivan Abramov <i.abramov@...integration.ru>
To: Steve French <sfrench@...ba.org>
CC: Ivan Abramov <i.abramov@...integration.ru>, Paulo Alcantara
<pc@...guebit.com>, Ronnie Sahlberg <ronniesahlberg@...il.com>, Shyam Prasad
N <sprasad@...rosoft.com>, Tom Talpey <tom@...pey.com>, Bharath SM
<bharathsm@...rosoft.com>, <linux-cifs@...r.kernel.org>,
<samba-technical@...ts.samba.org>, <linux-kernel@...r.kernel.org>,
<lvc-project@...uxtesting.org>
Subject: [PATCH] smb: client: Remove redundant check in cifs_oplock_break()
There is an unnecessary NULL check of inode in cifs_oplock_break(), since
there are multiple dereferences of cinode prior to it.
Based on usage of cifs_oplock_break() in cifs_new_fileinfo() we can safely
assume that inode is not NULL, so there is no need to check inode in
cifs_oplock_break() at all.
Therefore, this redundant check can be removed.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Ivan Abramov <i.abramov@...integration.ru>
---
fs/smb/client/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
index 8582cf61242c..66b775ae2f82 100644
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -3082,7 +3082,7 @@ void cifs_oplock_break(struct work_struct *work)
cinode->oplock = 0;
}
- if (inode && S_ISREG(inode->i_mode)) {
+ if (S_ISREG(inode->i_mode)) {
if (CIFS_CACHE_READ(cinode))
break_lease(inode, O_RDONLY);
else
--
2.39.5
Powered by blists - more mailing lists