diff options
| author | Paulo Alcantara <[email protected]> | 2025-07-26 16:38:52 +0000 |
|---|---|---|
| committer | Steve French <[email protected]> | 2025-07-28 14:40:36 +0000 |
| commit | 524fa5bcc384491140323f12bf12b6e3e0f5b84d (patch) | |
| tree | a4a016641d35fd82c97528996899d0954ef6a78b | |
| parent | smb: client: get rid of kstrdup() when parsing user mount option (diff) | |
| download | kernel-524fa5bcc384491140323f12bf12b6e3e0f5b84d.tar.gz kernel-524fa5bcc384491140323f12bf12b6e3e0f5b84d.zip | |
smb: client: get rid of kstrdup() when parsing pass 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]>
| -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 18b55f243b4c..c332d110704a 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1482,12 +1482,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, ctx->password = NULL; if (strlen(param->string) == 0) break; - - ctx->password = kstrdup(param->string, GFP_KERNEL); - if (ctx->password == NULL) { - cifs_errorf(fc, "OOM when copying password string\n"); - goto cifs_parse_mount_err; - } + ctx->password = no_free_ptr(param->string); break; case Opt_pass2: kfree_sensitive(ctx->password2); |
