Skip to content

Commit df57109

Browse files
sprasad-microsoftsmfrench
authored andcommitted
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: 3663c90 ("cifs: check reconnects for channels of active tcons too") Signed-off-by: Shyam Prasad N <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent ea90708 commit df57109

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/cifs/smb2pdu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,7 +3906,7 @@ void smb2_reconnect_server(struct work_struct *work)
39063906
goto done;
39073907

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

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

0 commit comments

Comments
 (0)