linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: hyperv: Cocci spatch "memdup.spatch"
@ 2013-06-01  9:40 Thomas Meyer
  2013-06-03 11:34 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Meyer @ 2013-06-01  9:40 UTC (permalink / raw)
  To: kys, haiyangz, jkosina, devel, linux-input, linux-kernel


Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
--- a/drivers/hid/hid-hyperv.c
+++ b/drivers/hid/hid-hyperv.c
@@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_i
 	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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: hyperv: Cocci spatch "memdup.spatch"
  2013-06-01  9:40 [PATCH] HID: hyperv: Cocci spatch "memdup.spatch" Thomas Meyer
@ 2013-06-03 11:34 ` Jiri Kosina
  2013-06-03 14:14   ` KY Srinivasan
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2013-06-03 11:34 UTC (permalink / raw)
  To: Thomas Meyer; +Cc: kys, haiyangz, devel, linux-input, linux-kernel

On Sat, 1 Jun 2013, Thomas Meyer wrote:

> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
> 
> diff -u -p a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
> --- a/drivers/hid/hid-hyperv.c
> +++ b/drivers/hid/hid-hyperv.c
> @@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_i
>  	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;
> 

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.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] HID: hyperv: Cocci spatch "memdup.spatch"
  2013-06-03 11:34 ` Jiri Kosina
@ 2013-06-03 14:14   ` KY Srinivasan
  0 siblings, 0 replies; 3+ messages in thread
From: KY Srinivasan @ 2013-06-03 14:14 UTC (permalink / raw)
  To: Jiri Kosina, Thomas Meyer
  Cc: devel@linuxdriverproject.org, Haiyang Zhang,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org



> -----Original Message-----
> From: Jiri Kosina [mailto:jkosina@suse.cz]
> Sent: Monday, June 03, 2013 7:35 AM
> To: Thomas Meyer
> Cc: KY Srinivasan; Haiyang Zhang; devel@linuxdriverproject.org; linux-
> input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] HID: hyperv: Cocci spatch "memdup.spatch"
> 
> On Sat, 1 Jun 2013, Thomas Meyer wrote:
> 
> > Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> > ---
> >
> > diff -u -p a/drivers/hid/hid-hyperv.c b/drivers/hid/hid-hyperv.c
> > --- a/drivers/hid/hid-hyperv.c
> > +++ b/drivers/hid/hid-hyperv.c
> > @@ -199,13 +199,11 @@ static void mousevsc_on_receive_device_i
> >  	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;
> >
> 
> 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.

Thanks Jiri!

K. Y
> 
> --
> Jiri Kosina
> SUSE Labs
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-03 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01  9:40 [PATCH] HID: hyperv: Cocci spatch "memdup.spatch" Thomas Meyer
2013-06-03 11:34 ` Jiri Kosina
2013-06-03 14:14   ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).