diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c index a9632c060bce..d517651d7bce 100644 --- a/fs/smb/client/connect.c +++ b/fs/smb/client/connect.c @@ -2034,6 +2034,12 @@ void __cifs_put_smb_ses(struct cifs_ses *ses) } } + /* we now account for primary channel in iface->refcount */ + if (ses->chans[0].iface) { + kref_put(&ses->chans[0].iface->refcount, release_iface); + ses->chans[0].server = NULL; + } + sesInfoFree(ses); cifs_put_tcp_session(server, 0); }