summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.c
diff options
context:
space:
mode:
authorYueHaibing2018-09-10 03:33:06 +0200
committerSteve French2018-10-24 04:16:03 +0200
commitd034feeb44b8a8fb473f1ba805db97787f54bf3a (patch)
tree15fece1cf2a7ac81e0eec37d5872f203bdcd1e7c /fs/cifs/smb2pdu.c
parentsmb3: do not display confusing message on mount to Azure servers (diff)
downloadkernel-qcow2-linux-d034feeb44b8a8fb473f1ba805db97787f54bf3a.tar.gz
kernel-qcow2-linux-d034feeb44b8a8fb473f1ba805db97787f54bf3a.tar.xz
kernel-qcow2-linux-d034feeb44b8a8fb473f1ba805db97787f54bf3a.zip
cifs: Use kmemdup rather than duplicating its implementation in smb311_posix_mkdir()
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r--fs/cifs/smb2pdu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index f54d07bda067..d7a41141ed38 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2474,13 +2474,13 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
goto ioctl_exit;
}
- *out_data = kmalloc(*plen, GFP_KERNEL);
+ *out_data = kmemdup((char *)rsp + le32_to_cpu(rsp->OutputOffset),
+ *plen, GFP_KERNEL);
if (*out_data == NULL) {
rc = -ENOMEM;
goto ioctl_exit;
}
- memcpy(*out_data, (char *)rsp + le32_to_cpu(rsp->OutputOffset), *plen);
ioctl_exit:
free_rsp_buf(resp_buftype, rsp);
return rc;