summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/hv_mouse.c
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-11-12 13:21:49 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-26 17:03:56 -0800
commit27b7923035f737a7e6384d0084e34706ea068040 (patch)
tree5e3a3d0eebe78450985a8b1768632d23a146fa6d /drivers/staging/hv/hv_mouse.c
parentb401731985bfa7c02e4e5673a151b29ae7180fce (diff)
downloadop-kernel-dev-27b7923035f737a7e6384d0084e34706ea068040.zip
op-kernel-dev-27b7923035f737a7e6384d0084e34706ea068040.tar.gz
staging: hv: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/hv_mouse.c')
-rw-r--r--drivers/staging/hv/hv_mouse.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 2c2e1b4..a28c549 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -201,13 +201,11 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
desc = &device_info->hid_descriptor;
WARN_ON(desc->bLength == 0);
- 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)
goto cleanup;
OpenPOWER on IntegriCloud