Commit 524fa5bc authored by Paulo Alcantara's avatar Paulo Alcantara Committed by Steve French
Browse files

smb: client: get rid of kstrdup() when parsing pass 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 e5acab35
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -1482,12 +1482,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
		ctx->password = NULL;
		if (strlen(param->string) == 0)
			break;

		ctx->password = kstrdup(param->string, GFP_KERNEL);
		if (ctx->password == NULL) {
			cifs_errorf(fc, "OOM when copying password string\n");
			goto cifs_parse_mount_err;
		}
		ctx->password = no_free_ptr(param->string);
		break;
	case Opt_pass2:
		kfree_sensitive(ctx->password2);