Skip to content

Commit 29954d5

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: fix leak of iface for primary channel
My last change in this area introduced a change which accounted for primary channel in the interface ref count. However, it did not reduce this ref count on deallocation of the primary channel. i.e. during umount. Fixing this leak here, by dropping this ref count for primary channel while freeing up the session. Fixes: fa1d050 ("cifs: account for primary channel in the interface list") Cc: [email protected] Reported-by: Paulo Alcantara <[email protected]> Signed-off-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 181724f commit 29954d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/smb/client/connect.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,6 +2065,12 @@ void __cifs_put_smb_ses(struct cifs_ses *ses)
20652065
ses->chans[i].server = NULL;
20662066
}
20672067

2068+
/* we now account for primary channel in iface->refcount */
2069+
if (ses->chans[0].iface) {
2070+
kref_put(&ses->chans[0].iface->refcount, release_iface);
2071+
ses->chans[0].server = NULL;
2072+
}
2073+
20682074
sesInfoFree(ses);
20692075
cifs_put_tcp_session(server, 0);
20702076
}

0 commit comments

Comments
 (0)