HID: hyperv: Cocci spatch "memdup.spatch"
Subsystems (2)
PATCH 1/1 HID: hyperv: Cocci spatch "memdup.spatch"
---
drivers/hid/hid-hyperv.c +1 -3
@@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_iif (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 ;
Quoted 12 lines · Thomas Meyer
Signed-off-by Thomas Meyer <[email protected]>---
diff -u -p
a/drivers/hid/hid-hyperv.cb/drivers/hid/hid-hyperv.cdrivers/hid/hid-hyperv.c +0
-1@@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_iif (desc->bLength ==0 ) goto cleanup; - input_device->hid_desc =kzalloc (desc->bLength,GFP_ATOMIC );
drivers/hid/hid-hyperv.c static void mousevsc_on_receive_device_i · line 209
Quoted 10 lines
drivers/hid/hid-hyperv.c +1
-2+ 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 ;
I guess you are going to get some pushback from some maintainers due to non-descriptive subject and missing changelog :)
I have fixed this for the hyperv patch and applied it, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs
Quoted 39 lines
-----Original Message-----
From: Jiri Kosina [mailto:[email protected]]
Sent: Monday, June 03, 2013 7:35 AM
To: Thomas Meyer
Cc: KY Srinivasan; Haiyang Zhang; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [PATCH] HID: hyperv: Cocci spatch "memdup.spatch"drivers/hid/hid-hyperv.c static void mousevsc_on_receive_device_i · line 202
Quoted 12 lines · Thomas Meyer
Signed-off-by Thomas Meyer <[email protected]>---
diff -u -p
a/drivers/hid/hid-hyperv.cb/drivers/hid/hid-hyperv.cdrivers/hid/hid-hyperv.c +1
-1@@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_iif (desc->bLength ==0 ) goto cleanup; - input_device->hid_desc =kzalloc (desc->bLength,GFP_ATOMIC ); + input_device->hid_desc = kmemdup(desc, desc->bLength,
GFP_ATOMIC);drivers/hid/hid-hyperv.c static void mousevsc_on_receive_device_i
Quoted 10 lines
drivers/hid/hid-hyperv.c +0
-2if (!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 ;I guess you are going to get some pushback from some maintainers due to non-descriptive subject and missing changelog :)
Quoted 1 line
I have fixed this for the hyperv patch and applied it, thanks.
Thanks Jiri!
K. Y
Quoted 5 lines
--
Jiri Kosina
SUSE Labs