diff mbox series

[16/21] cifs: don't create a temp nls in cifs_setup_ipc

Message ID 20201207233646.29823-16-lsahlber@redhat.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Ronnie Sahlberg Dec. 7, 2020, 11:36 p.m. UTC
just use the one that is already available in ctx

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/connect.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index f2698090b39a..22b5f3544947 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1493,7 +1493,6 @@  cifs_setup_ipc(struct cifs_ses *ses, struct smb3_fs_context *ctx)
 {
 	int rc = 0, xid;
 	struct cifs_tcon *tcon;
-	struct nls_table *nls_codepage;
 	char unc[SERVER_NAME_LENGTH + sizeof("//x/IPC$")] = {0};
 	bool seal = false;
 	struct TCP_Server_Info *server = ses->server;
@@ -1518,14 +1517,11 @@  cifs_setup_ipc(struct cifs_ses *ses, struct smb3_fs_context *ctx)
 
 	scnprintf(unc, sizeof(unc), "\\\\%s\\IPC$", server->hostname);
 
-	/* cannot fail */
-	nls_codepage = load_nls_default();
-
 	xid = get_xid();
 	tcon->ses = ses;
 	tcon->ipc = true;
 	tcon->seal = seal;
-	rc = server->ops->tree_connect(xid, ses, unc, tcon, nls_codepage);
+	rc = server->ops->tree_connect(xid, ses, unc, tcon, ctx->local_nls);
 	free_xid(xid);
 
 	if (rc) {
@@ -1538,7 +1534,6 @@  cifs_setup_ipc(struct cifs_ses *ses, struct smb3_fs_context *ctx)
 
 	ses->tcon_ipc = tcon;
 out:
-	unload_nls(nls_codepage);
 	return rc;
 }