]> Git Repo - linux.git/commitdiff
cifs: add NULL check for ses->tcon_ipc
authorAurelien Aptel <[email protected]>
Thu, 3 Dec 2020 18:46:08 +0000 (19:46 +0100)
committerSteve French <[email protected]>
Thu, 3 Dec 2020 23:06:03 +0000 (17:06 -0600)
In some scenarios (DFS and BAD_NETWORK_NAME) set_root_set() can be
called with a NULL ses->tcon_ipc.

Signed-off-by: Aurelien Aptel <[email protected]>
Reviewed-by: Paulo Alcantara (SUSE) <[email protected]>
CC: Stable <[email protected]>
Signed-off-by: Steve French <[email protected]>
fs/cifs/connect.c

index 28c1459fb0fc06d78cf56a02e27898dc3d294a6c..44f9cce57099583cba0e2ef99bcfb963f88b91f1 100644 (file)
@@ -4546,7 +4546,8 @@ static void set_root_ses(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
        if (ses) {
                spin_lock(&cifs_tcp_ses_lock);
                ses->ses_count++;
-               ses->tcon_ipc->remap = cifs_remap(cifs_sb);
+               if (ses->tcon_ipc)
+                       ses->tcon_ipc->remap = cifs_remap(cifs_sb);
                spin_unlock(&cifs_tcp_ses_lock);
        }
        *root_ses = ses;
This page took 0.053498 seconds and 4 git commands to generate.