cifs: fix missing unload_nls() in smb2_reconnect()
[ Upstream commit c24bb1a87dc3f2d77d410eaac2c6a295961bf50e ] Make sure to unload_nls() @nls_codepage if we no longer need it. Fixes: bc962159e8e3 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e0169d62ef
commit
2b4830eefc
@ -144,7 +144,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
|
||||
struct TCP_Server_Info *server)
|
||||
{
|
||||
int rc = 0;
|
||||
struct nls_table *nls_codepage;
|
||||
struct nls_table *nls_codepage = NULL;
|
||||
struct cifs_ses *ses;
|
||||
|
||||
/*
|
||||
@ -216,8 +216,6 @@ again:
|
||||
tcon->ses->chans_need_reconnect,
|
||||
tcon->need_reconnect);
|
||||
|
||||
nls_codepage = load_nls_default();
|
||||
|
||||
mutex_lock(&ses->session_mutex);
|
||||
/*
|
||||
* Recheck after acquire mutex. If another thread is negotiating
|
||||
@ -237,6 +235,8 @@ again:
|
||||
}
|
||||
spin_unlock(&server->srv_lock);
|
||||
|
||||
nls_codepage = load_nls_default();
|
||||
|
||||
/*
|
||||
* need to prevent multiple threads trying to simultaneously
|
||||
* reconnect the same SMB session
|
||||
|
Loading…
x
Reference in New Issue
Block a user