Skip to content

Commit

Permalink
ksmbd: Remove unused parameter from smb2_get_name()
Browse files Browse the repository at this point in the history
The 'share' parameter is no longer used by smb2_get_name() since
commit 265fd19 ("ksmbd: use LOOKUP_BENEATH to prevent the out of
share access").

Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Marios Makassikis authored and Steve French committed Dec 29, 2021
1 parent 2942774 commit 80917f1
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions fs/ksmbd/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,16 +610,14 @@ static void destroy_previous_session(struct ksmbd_user *user, u64 id)

/**
* smb2_get_name() - get filename string from on the wire smb format
* @share: ksmbd_share_config pointer
* @src: source buffer
* @maxlen: maxlen of source string
* @nls_table: nls_table pointer
*
* Return: matching converted filename on success, otherwise error ptr
*/
static char *
smb2_get_name(struct ksmbd_share_config *share, const char *src,
const int maxlen, struct nls_table *local_nls)
smb2_get_name(const char *src, const int maxlen, struct nls_table *local_nls)
{
char *name;

Expand Down Expand Up @@ -2530,8 +2528,7 @@ int smb2_open(struct ksmbd_work *work)
goto err_out1;
}

name = smb2_get_name(share,
req->Buffer,
name = smb2_get_name(req->Buffer,
le16_to_cpu(req->NameLength),
work->conn->local_nls);
if (IS_ERR(name)) {
Expand Down Expand Up @@ -5398,8 +5395,7 @@ static int smb2_rename(struct ksmbd_work *work,
goto out;
}

new_name = smb2_get_name(share,
file_info->FileName,
new_name = smb2_get_name(file_info->FileName,
le32_to_cpu(file_info->FileNameLength),
local_nls);
if (IS_ERR(new_name)) {
Expand Down Expand Up @@ -5510,8 +5506,7 @@ static int smb2_create_link(struct ksmbd_work *work,
if (!pathname)
return -ENOMEM;

link_name = smb2_get_name(share,
file_info->FileName,
link_name = smb2_get_name(file_info->FileName,
le32_to_cpu(file_info->FileNameLength),
local_nls);
if (IS_ERR(link_name) || S_ISDIR(file_inode(filp)->i_mode)) {
Expand Down

0 comments on commit 80917f1

Please sign in to comment.