mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
smb: client: get rid of kstrdup() when parsing pass2 mount option
Steal string reference from @param->string rather than duplicating it. Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> Reviewed-by: David Howells <dhowells@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
524fa5bcc3
commit
1b6075ebd3
|
|
@ -1489,12 +1489,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
|
|||
ctx->password2 = NULL;
|
||||
if (strlen(param->string) == 0)
|
||||
break;
|
||||
|
||||
ctx->password2 = kstrdup(param->string, GFP_KERNEL);
|
||||
if (ctx->password2 == NULL) {
|
||||
cifs_errorf(fc, "OOM when copying password2 string\n");
|
||||
goto cifs_parse_mount_err;
|
||||
}
|
||||
ctx->password2 = no_free_ptr(param->string);
|
||||
break;
|
||||
case Opt_ip:
|
||||
if (strlen(param->string) == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user