diff options
| author | Paulo Alcantara <pc@manguebit.org> | 2025-07-26 13:36:51 -0300 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-07-28 09:40:20 -0500 |
| commit | e5acab35feffb6f1b7f4ee0d146666a241024804 (patch) | |
| tree | f381a0ec3321f25a89569b92535c6ed0cbfe7a24 | |
| parent | 309c2b776c8716d4e3b98506bde3ccd131f2fae6 (diff) | |
smb: client: get rid of kstrdup() when parsing user 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 | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index 59ccc2229ab3..18b55f243b4c 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1475,11 +1475,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, pr_warn("username too long\n"); goto cifs_parse_mount_err; } - ctx->username = kstrdup(param->string, GFP_KERNEL); - if (ctx->username == NULL) { - cifs_errorf(fc, "OOM when copying username string\n"); - goto cifs_parse_mount_err; - } + ctx->username = no_free_ptr(param->string); break; case Opt_pass: kfree_sensitive(ctx->password); |
