From: Paulo Alcantara Date: Sat, 26 Jul 2025 16:45:43 +0000 (-0300) Subject: smb: client: get rid of kstrdup() when parsing domain mount option X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60c9511253d508bbc9df8d988f38ce2a633ead86;p=thirdparty%2Fkernel%2Flinux.git 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) Reviewed-by: David Howells Signed-off-by: Steve French --- diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index f29efc03e8050..8b7ad5bf3302b 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1512,11 +1512,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, } kfree(ctx->domainname); - ctx->domainname = kstrdup(param->string, GFP_KERNEL); - if (ctx->domainname == NULL) { - cifs_errorf(fc, "OOM when copying domainname string\n"); - goto cifs_parse_mount_err; - } + ctx->domainname = no_free_ptr(param->string); cifs_dbg(FYI, "Domain name set\n"); break; case Opt_srcaddr: