mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 18:40:10 +00:00
cifs: fix missing unload_nls() in smb2_reconnect()
Make sure to unload_nls() @nls_codepage if we no longer need it.
Fixes: bc962159e8 ("cifs: avoid race conditions with parallel reconnects")
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
committed by
Steve French
parent
bc962159e8
commit
c24bb1a87d
@@ -144,7 +144,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
|
|||||||
struct TCP_Server_Info *server)
|
struct TCP_Server_Info *server)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct nls_table *nls_codepage;
|
struct nls_table *nls_codepage = NULL;
|
||||||
struct cifs_ses *ses;
|
struct cifs_ses *ses;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -220,8 +220,6 @@ again:
|
|||||||
tcon->ses->chans_need_reconnect,
|
tcon->ses->chans_need_reconnect,
|
||||||
tcon->need_reconnect);
|
tcon->need_reconnect);
|
||||||
|
|
||||||
nls_codepage = load_nls_default();
|
|
||||||
|
|
||||||
mutex_lock(&ses->session_mutex);
|
mutex_lock(&ses->session_mutex);
|
||||||
/*
|
/*
|
||||||
* Recheck after acquire mutex. If another thread is negotiating
|
* Recheck after acquire mutex. If another thread is negotiating
|
||||||
@@ -241,6 +239,8 @@ again:
|
|||||||
}
|
}
|
||||||
spin_unlock(&server->srv_lock);
|
spin_unlock(&server->srv_lock);
|
||||||
|
|
||||||
|
nls_codepage = load_nls_default();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* need to prevent multiple threads trying to simultaneously
|
* need to prevent multiple threads trying to simultaneously
|
||||||
* reconnect the same SMB session
|
* reconnect the same SMB session
|
||||||
|
|||||||
Reference in New Issue
Block a user