Skip to content

Commit c24bb1a

Browse files
Paulo AlcantaraSteve French
authored andcommitted
cifs: fix missing unload_nls() in smb2_reconnect()
Make sure to unload_nls() @nls_codepage if we no longer need it. Fixes: bc96215 ("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>
1 parent bc96215 commit c24bb1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/cifs/smb2pdu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
144144
struct TCP_Server_Info *server)
145145
{
146146
int rc = 0;
147-
struct nls_table *nls_codepage;
147+
struct nls_table *nls_codepage = NULL;
148148
struct cifs_ses *ses;
149149

150150
/*
@@ -220,8 +220,6 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
220220
tcon->ses->chans_need_reconnect,
221221
tcon->need_reconnect);
222222

223-
nls_codepage = load_nls_default();
224-
225223
mutex_lock(&ses->session_mutex);
226224
/*
227225
* Recheck after acquire mutex. If another thread is negotiating
@@ -241,6 +239,8 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
241239
}
242240
spin_unlock(&server->srv_lock);
243241

242+
nls_codepage = load_nls_default();
243+
244244
/*
245245
* need to prevent multiple threads trying to simultaneously
246246
* reconnect the same SMB session

0 commit comments

Comments
 (0)