Commit 28f09823 authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French
Browse files

smb: client: get rid of kstrdup() when parsing iocharset mount option



Steal string reference from @param->string rather than duplicating it.

Signed-off-by: default avatarPaulo Alcantara (Red Hat) <pc@manguebit.org>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 60c95112
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -1532,11 +1532,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,

		if (strncasecmp(param->string, "default", 7) != 0) {
			kfree(ctx->iocharset);
			ctx->iocharset = kstrdup(param->string, GFP_KERNEL);
			if (ctx->iocharset == NULL) {
				cifs_errorf(fc, "OOM when copying iocharset string\n");
				goto cifs_parse_mount_err;
			}
			ctx->iocharset = no_free_ptr(param->string);
		}
		/* if iocharset not set then load_nls_default
		 * is used by caller