Skip to content

Commit f089ee0

Browse files
Ivan AbramovSteve French
authored andcommitted
smb: client: Remove redundant check in smb2_is_path_accessible()
There is an unnecessary NULL check of cifs_sb in smb2_is_path_accessible(), since cifs_sb is dereferenced multiple times prior to it. It seems that there is no need to introduce any NULL checks of cifs_sb, since arguments of smb2_is_path_accessible() are assumed to be non-NULL. 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 9fb2e20 commit f089ee0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/smb2ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
969969
if (islink)
970970
rc = -EREMOTE;
971971
}
972-
if (rc == -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) && cifs_sb &&
972+
if (rc == -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) &&
973973
(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS))
974974
rc = -EOPNOTSUPP;
975975
goto out;

0 commit comments

Comments
 (0)