提交 a4a23f6d 编写于 作者: T Thomas Meyer 提交者: Jiri Kosina

HID: hyperv: convert alloc+memcpy to memdup

Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 b1a1442a
......@@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
if (desc->bLength == 0)
goto cleanup;
input_device->hid_desc = kzalloc(desc->bLength, GFP_ATOMIC);
input_device->hid_desc = kmemdup(desc, desc->bLength, GFP_ATOMIC);
if (!input_device->hid_desc)
goto cleanup;
memcpy(input_device->hid_desc, desc, desc->bLength);
input_device->report_desc_size = desc->desc[0].wDescriptorLength;
if (input_device->report_desc_size == 0) {
input_device->dev_info_status = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册