diff options
author | 2025-07-26 13:47:51 -0300 | |
---|---|---|
committer | 2025-07-28 09:42:53 -0500 | |
commit | 28f09823de9292c6f91171f0627bd0b360b78a75 (patch) | |
tree | 15ee3e3bd897f34b911d19eb3a4f8bc192ae8f81 | |
parent | smb: client: get rid of kstrdup() when parsing domain mount option (diff) | |
download | wireguard-linux-28f09823de9292c6f91171f0627bd0b360b78a75.tar.xz wireguard-linux-28f09823de9292c6f91171f0627bd0b360b78a75.zip |
smb: client: get rid of kstrdup() when parsing iocharset 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 8b7ad5bf3302..3f34bb07997b 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -1532,11 +1532,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, if (strncasecmp(param->string, "default", 7) != 0) { kfree(ctx->iocharset); - ctx->iocharset = kstrdup(param->string, GFP_KERNEL); - if (ctx->iocharset == NULL) { - cifs_errorf(fc, "OOM when copying iocharset string\n"); - goto cifs_parse_mount_err; - } + ctx->iocharset = no_free_ptr(param->string); } /* if iocharset not set then load_nls_default * is used by caller |