Skip to content

Commit 59463eb

Browse files
aaptelsmfrench
authored andcommitted
cifs: add NULL check for ses->tcon_ipc
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 <aaptel@suse.com> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> CC: Stable <stable@vger.kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 7963178 commit 59463eb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/cifs/connect.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4546,7 +4546,8 @@ static void set_root_ses(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
45464546
if (ses) {
45474547
spin_lock(&cifs_tcp_ses_lock);
45484548
ses->ses_count++;
4549-
ses->tcon_ipc->remap = cifs_remap(cifs_sb);
4549+
if (ses->tcon_ipc)
4550+
ses->tcon_ipc->remap = cifs_remap(cifs_sb);
45504551
spin_unlock(&cifs_tcp_ses_lock);
45514552
}
45524553
*root_ses = ses;

0 commit comments

Comments
 (0)