mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
HID: hyperv: convert alloc+memcpy to memdup
Signed-off-by: Thomas Meyer <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
b1a1442a23
commit
a4a23f6d68
1 changed files with 1 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue