]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: client: Remove redundant check in cifs_oplock_break()
authorIvan Abramov <i.abramov@mt-integration.ru>
Mon, 10 Mar 2025 14:04:06 +0000 (17:04 +0300)
committerSteve French <stfrench@microsoft.com>
Mon, 24 Mar 2025 14:45:07 +0000 (09:45 -0500)
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>
fs/smb/client/file.c

index 8582cf61242c60fcea5a94f81a695dc6f09e6fb6..66b775ae2f821f41b06908aeb04cad2a06ea4480 100644 (file)
@@ -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