Skip to content

Commit 1b6075e

Browse files
pcacjrsmfrench
authored andcommitted
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) <[email protected]> Reviewed-by: David Howells <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 524fa5b commit 1b6075e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

fs/smb/client/fs_context.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,12 +1489,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
14891489
ctx->password2 = NULL;
14901490
if (strlen(param->string) == 0)
14911491
break;
1492-
1493-
ctx->password2 = kstrdup(param->string, GFP_KERNEL);
1494-
if (ctx->password2 == NULL) {
1495-
cifs_errorf(fc, "OOM when copying password2 string\n");
1496-
goto cifs_parse_mount_err;
1497-
}
1492+
ctx->password2 = no_free_ptr(param->string);
14981493
break;
14991494
case Opt_ip:
15001495
if (strlen(param->string) == 0) {

0 commit comments

Comments
 (0)