diff options
author | Paulo Alcantara <pc@manguebit.org> | 2025-07-26 13:40:28 -0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2025-07-28 09:41:17 -0500 |
commit | 1b6075ebd34da9c79243416f4c24d418fa490059 (patch) | |
tree | c9276412db7ca8e5a255d182587bc95c7de20da7 | |
parent | 524fa5bcc384491140323f12bf12b6e3e0f5b84d (diff) |
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>
-rw-r--r-- | fs/smb/client/fs_context.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index c332d110704a2..f29efc03e8050 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -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) { |