Skip to content

Commit 60c9511

Browse files
pcacjrsmfrench
authored andcommitted
smb: client: get rid of kstrdup() when parsing domain 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 1b6075e commit 60c9511

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

fs/smb/client/fs_context.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,11 +1512,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
15121512
}
15131513

15141514
kfree(ctx->domainname);
1515-
ctx->domainname = kstrdup(param->string, GFP_KERNEL);
1516-
if (ctx->domainname == NULL) {
1517-
cifs_errorf(fc, "OOM when copying domainname string\n");
1518-
goto cifs_parse_mount_err;
1519-
}
1515+
ctx->domainname = no_free_ptr(param->string);
15201516
cifs_dbg(FYI, "Domain name set\n");
15211517
break;
15221518
case Opt_srcaddr:

0 commit comments

Comments
 (0)