Commit df57109b authored by Shyam Prasad N's avatar Shyam Prasad N Committed by Steve French
Browse files

cifs: use tcon allocation functions even for dummy tcon



In smb2_reconnect_server, we allocate a dummy tcon for
calling reconnect for just the session. This should be
allocated using tconInfoAlloc, and not kmalloc.

Fixes: 3663c904 ("cifs: check reconnects for channels of active tcons too")
Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent ea90708d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3906,7 +3906,7 @@ void smb2_reconnect_server(struct work_struct *work)
		goto done;

	/* allocate a dummy tcon struct used for reconnect */
	tcon = kzalloc(sizeof(struct cifs_tcon), GFP_KERNEL);
	tcon = tconInfoAlloc();
	if (!tcon) {
		resched = true;
		list_for_each_entry_safe(ses, ses2, &tmp_ses_list, rlist) {
@@ -3929,7 +3929,7 @@ void smb2_reconnect_server(struct work_struct *work)
		list_del_init(&ses->rlist);
		cifs_put_smb_ses(ses);
	}
	kfree(tcon);
	tconInfoFree(tcon);

done:
	cifs_dbg(FYI, "Reconnecting tcons and channels finished\n");