Unverified Commit a9a1ac4d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13115 smb: client: Handle kstrdup failures for passwords

parents ceb2f847 58673ac6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -918,8 +918,15 @@ static int smb3_reconfigure(struct fs_context *fc)
	else  {
		kfree_sensitive(ses->password);
		ses->password = kstrdup(ctx->password, GFP_KERNEL);
		if (!ses->password)
			return -ENOMEM;
		kfree_sensitive(ses->password2);
		ses->password2 = kstrdup(ctx->password2, GFP_KERNEL);
		if (!ses->password2) {
			kfree_sensitive(ses->password);
			ses->password = NULL;
			return -ENOMEM;
		}
	}
	STEAL_STRING(cifs_sb, ctx, domainname);
	STEAL_STRING(cifs_sb, ctx, nodename);