Skip to content

Commit 9fb2e20

Browse files
Ivan AbramovSteve French
authored andcommitted
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@mt-integration.ru> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent faf1b64 commit 9fb2e20

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3082,7 +3082,7 @@ void cifs_oplock_break(struct work_struct *work)
30823082
cinode->oplock = 0;
30833083
}
30843084

3085-
if (inode && S_ISREG(inode->i_mode)) {
3085+
if (S_ISREG(inode->i_mode)) {
30863086
if (CIFS_CACHE_READ(cinode))
30873087
break_lease(inode, O_RDONLY);
30883088
else

0 commit comments

Comments
 (0)