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>
This commit is contained in:
parent
d42c8a87d1
commit
d034feeb44
@ -2474,13 +2474,13 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
|
|||||||
goto ioctl_exit;
|
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) {
|
if (*out_data == NULL) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto ioctl_exit;
|
goto ioctl_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(*out_data, (char *)rsp + le32_to_cpu(rsp->OutputOffset), *plen);
|
|
||||||
ioctl_exit:
|
ioctl_exit:
|
||||||
free_rsp_buf(resp_buftype, rsp);
|
free_rsp_buf(resp_buftype, rsp);
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user