Commit 60c95112 authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French
Browse files

smb: client: get rid of kstrdup() when parsing domain 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 1b6075eb
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -1512,11 +1512,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
		}

		kfree(ctx->domainname);
		ctx->domainname = kstrdup(param->string, GFP_KERNEL);
		if (ctx->domainname == NULL) {
			cifs_errorf(fc, "OOM when copying domainname string\n");
			goto cifs_parse_mount_err;
		}
		ctx->domainname = no_free_ptr(param->string);
		cifs_dbg(FYI, "Domain name set\n");
		break;
	case Opt_srcaddr: