summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorEnzo Matsumiya <ematsumiya@suse.de>2024-06-06 13:13:13 -0300
committerSteve French <stfrench@microsoft.com>2024-06-07 01:05:07 -0500
commit02c418774f76a0a36a6195c9dbf8971eb4130a15 (patch)
tree56904ad28f049e7936f3e2a7f9a9d18ceac779e3 /fs
parentc3f38fa61af77b49866b006939479069cd451173 (diff)
smb: client: fix deadlock in smb2_find_smb_tcon()
Unlock cifs_tcp_ses_lock before calling cifs_put_smb_ses() to avoid such deadlock. Cc: stable@vger.kernel.org Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/smb/client/smb2transport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/client/smb2transport.c b/fs/smb/client/smb2transport.c
index 02135a605305..1476c445cadc 100644
--- a/fs/smb/client/smb2transport.c
+++ b/fs/smb/client/smb2transport.c
@@ -216,8 +216,8 @@ smb2_find_smb_tcon(struct TCP_Server_Info *server, __u64 ses_id, __u32 tid)
}
tcon = smb2_find_smb_sess_tcon_unlocked(ses, tid);
if (!tcon) {
- cifs_put_smb_ses(ses);
spin_unlock(&cifs_tcp_ses_lock);
+ cifs_put_smb_ses(ses);
return NULL;
}
spin_unlock(&cifs_tcp_ses_lock);