aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2013-06-01 05:40:31 -0400
committerJiri Kosina <jkosina@suse.cz>2013-06-03 07:32:22 -0400
commita4a23f6d68ad2c86ee8df6a6f89c9d315c0a761c (patch)
tree14f85cff91fbc5d09a10b2791b03220bb3f0eeab
parentb1a1442a23776756b254b69786848a94d92445ba (diff)
HID: hyperv: convert alloc+memcpy to memdup
Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-hyperv.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
index aa3fec0d9dc6..713217380b44 100644
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
199 if (desc->bLength == 0) 199 if (desc->bLength == 0)
200 goto cleanup; 200 goto cleanup;
201 201
202 input_device->hid_desc = kzalloc(desc->bLength, GFP_ATOMIC); 202 input_device->hid_desc = kmemdup(desc, desc->bLength, GFP_ATOMIC);
203 203
204 if (!input_device->hid_desc) 204 if (!input_device->hid_desc)
205 goto cleanup; 205 goto cleanup;
206 206
207 memcpy(input_device->hid_desc, desc, desc->bLength);
208
209 input_device->report_desc_size = desc->desc[0].wDescriptorLength; 207 input_device->report_desc_size = desc->desc[0].wDescriptorLength;
210 if (input_device->report_desc_size == 0) { 208 if (input_device->report_desc_size == 0) {
211 input_device->dev_info_status = -EINVAL; 209 input_device->dev_info_status = -EINVAL;