mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
cifs: move from strlcpy with unused retval to strscpy
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
ca08d0eac0
commit
13609a8b3a
@ -59,7 +59,7 @@ static int __init cifs_root_setup(char *line)
|
||||
pr_err("Root-CIFS: UNC path too long\n");
|
||||
return 1;
|
||||
}
|
||||
strlcpy(root_dev, line, len);
|
||||
strscpy(root_dev, line, len);
|
||||
srvaddr = parse_srvaddr(&line[2], s);
|
||||
if (*s) {
|
||||
int n = snprintf(root_opts,
|
||||
|
@ -3994,7 +3994,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
|
||||
}
|
||||
bcc_ptr += length + 1;
|
||||
bytes_left -= (length + 1);
|
||||
strlcpy(tcon->treeName, tree, sizeof(tcon->treeName));
|
||||
strscpy(tcon->treeName, tree, sizeof(tcon->treeName));
|
||||
|
||||
/* mostly informational -- no need to fail on error here */
|
||||
kfree(tcon->nativeFileSystem);
|
||||
|
@ -1928,7 +1928,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
|
||||
tcon->capabilities = rsp->Capabilities; /* we keep caps little endian */
|
||||
tcon->maximal_access = le32_to_cpu(rsp->MaximalAccess);
|
||||
tcon->tid = le32_to_cpu(rsp->hdr.Id.SyncId.TreeId);
|
||||
strlcpy(tcon->treeName, tree, sizeof(tcon->treeName));
|
||||
strscpy(tcon->treeName, tree, sizeof(tcon->treeName));
|
||||
|
||||
if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) &&
|
||||
((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
|
||||
|
Loading…
Reference in New Issue
Block a user