]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: client: Remove redundant check in smb2_is_path_accessible()
authorIvan Abramov <i.abramov@mt-integration.ru>
Mon, 10 Mar 2025 14:04:58 +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 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>
fs/smb/client/smb2ops.c

index 4dd11eafb69d9cc7e79de85ed07e0c54af21174e..6958825431af25e5a646cbebcc367994144829e2 100644 (file)
@@ -969,7 +969,7 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
                        if (islink)
                                rc = -EREMOTE;
                }
-               if (rc == -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) && cifs_sb &&
+               if (rc == -EREMOTE && IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) &&
                    (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_DFS))
                        rc = -EOPNOTSUPP;
                goto out;