linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: intel-ish-hid: fixes incorrect error handling
@ 2018-11-22  0:52 Pan Bian
  2018-12-07 14:23 ` Benjamin Tissoires
  2018-12-17 14:05 ` Jiri Kosina
  0 siblings, 2 replies; 5+ messages in thread
From: Pan Bian @ 2018-11-22  0:52 UTC (permalink / raw)
  To: Srinivas Pandruvada, Jiri Kosina, Benjamin Tissoires
  Cc: linux-input, linux-kernel

The memory chunk allocated by hid_allocate_device() should be released
by hid_destroy_device(), not kfree().

Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver")
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
index cd23903..e918d78 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
@@ -222,7 +222,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
 err_hid_device:
 	kfree(hid_data);
 err_hid_data:
-	kfree(hid);
+	hid_destroy_device(hid);
 	return rv;
 }
 
-- 
2.7.4



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

* Re: [PATCH] HID: intel-ish-hid: fixes incorrect error handling
  2018-11-22  0:52 [PATCH] HID: intel-ish-hid: fixes incorrect error handling Pan Bian
@ 2018-12-07 14:23 ` Benjamin Tissoires
  2018-12-09 20:45   ` Jiri Kosina
  2018-12-17 14:05 ` Jiri Kosina
  1 sibling, 1 reply; 5+ messages in thread
From: Benjamin Tissoires @ 2018-12-07 14:23 UTC (permalink / raw)
  To: bianpan2016
  Cc: Srinivas Pandruvada, Jiri Kosina, open list:HID CORE LAYER, lkml

On Thu, Nov 22, 2018 at 1:52 AM Pan Bian <bianpan2016@163.com> wrote:
>
> The memory chunk allocated by hid_allocate_device() should be released
> by hid_destroy_device(), not kfree().
>
> Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver")
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>  drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
> index cd23903..e918d78 100644
> --- a/drivers/hid/intel-ish-hid/ishtp-hid.c
> +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
> @@ -222,7 +222,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
>  err_hid_device:
>         kfree(hid_data);
>  err_hid_data:
> -       kfree(hid);
> +       hid_destroy_device(hid);

Looks good to me. Srinivas, any comments?
FWIW:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Jiri, do you think we should send this one as 4.20/fixes material or
wait for 4.21?

Cheers,
Benjamin

>         return rv;
>  }
>
> --
> 2.7.4
>
>

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

* Re: [PATCH] HID: intel-ish-hid: fixes incorrect error handling
  2018-12-07 14:23 ` Benjamin Tissoires
@ 2018-12-09 20:45   ` Jiri Kosina
  2018-12-10  3:20     ` Srinivas Pandruvada
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Kosina @ 2018-12-09 20:45 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: bianpan2016, Srinivas Pandruvada, open list:HID CORE LAYER, lkml

On Fri, 7 Dec 2018, Benjamin Tissoires wrote:

> > The memory chunk allocated by hid_allocate_device() should be released
> > by hid_destroy_device(), not kfree().
> >
> > Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver")
> > Signed-off-by: Pan Bian <bianpan2016@163.com>
> > ---
> >  drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
> > index cd23903..e918d78 100644
> > --- a/drivers/hid/intel-ish-hid/ishtp-hid.c
> > +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
> > @@ -222,7 +222,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
> >  err_hid_device:
> >         kfree(hid_data);
> >  err_hid_data:
> > -       kfree(hid);
> > +       hid_destroy_device(hid);
> 
> Looks good to me. Srinivas, any comments?
> FWIW:
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> 
> Jiri, do you think we should send this one as 4.20/fixes material or
> wait for 4.21?

Given that this has been around since 4.9, I wouldn't be devastated if it 
lands only in next merge window. So I'd just put it to 4.20/fixes and wait 
for other more serious trigger for sending that to Linus eventually.

Thanks,

-- 
Jiri Kosina
SUSE Labs


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

* Re: [PATCH] HID: intel-ish-hid: fixes incorrect error handling
  2018-12-09 20:45   ` Jiri Kosina
@ 2018-12-10  3:20     ` Srinivas Pandruvada
  0 siblings, 0 replies; 5+ messages in thread
From: Srinivas Pandruvada @ 2018-12-10  3:20 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: bianpan2016, open list:HID CORE LAYER, lkml

On Sun, 2018-12-09 at 21:45 +0100, Jiri Kosina wrote:
> On Fri, 7 Dec 2018, Benjamin Tissoires wrote:
> 
> > > The memory chunk allocated by hid_allocate_device() should be
> > > released
> > > by hid_destroy_device(), not kfree().
> > > 
> > > Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver")
> > > Signed-off-by: Pan Bian <bianpan2016@163.com>
> > > ---
> > >  drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c
> > > b/drivers/hid/intel-ish-hid/ishtp-hid.c
> > > index cd23903..e918d78 100644
> > > --- a/drivers/hid/intel-ish-hid/ishtp-hid.c
> > > +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
> > > @@ -222,7 +222,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
> > >  err_hid_device:
> > >         kfree(hid_data);
> > >  err_hid_data:
> > > -       kfree(hid);
> > > +       hid_destroy_device(hid);
> > 
> > Looks good to me. Srinivas, any comments?
> > FWIW:
> > Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> > 
> > Jiri, do you think we should send this one as 4.20/fixes material
> > or
> > wait for 4.21?
> 
> Given that this has been around since 4.9, I wouldn't be devastated
> if it 
> lands only in next merge window. So I'd just put it to 4.20/fixes and
> wait 
> for other more serious trigger for sending that to Linus eventually.
> 
Agree.

Thanks,
Srinivas

> Thanks,
> 


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

* Re: [PATCH] HID: intel-ish-hid: fixes incorrect error handling
  2018-11-22  0:52 [PATCH] HID: intel-ish-hid: fixes incorrect error handling Pan Bian
  2018-12-07 14:23 ` Benjamin Tissoires
@ 2018-12-17 14:05 ` Jiri Kosina
  1 sibling, 0 replies; 5+ messages in thread
From: Jiri Kosina @ 2018-12-17 14:05 UTC (permalink / raw)
  To: Pan Bian
  Cc: Srinivas Pandruvada, Benjamin Tissoires, linux-input, linux-kernel

On Thu, 22 Nov 2018, Pan Bian wrote:

> The memory chunk allocated by hid_allocate_device() should be released
> by hid_destroy_device(), not kfree().
> 
> Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver")
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>  drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c
> index cd23903..e918d78 100644
> --- a/drivers/hid/intel-ish-hid/ishtp-hid.c
> +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c
> @@ -222,7 +222,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev,
>  err_hid_device:
>  	kfree(hid_data);
>  err_hid_data:
> -	kfree(hid);
> +	hid_destroy_device(hid);
>  	return rv;

Applied to for-4.20/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs


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

end of thread, other threads:[~2018-12-17 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22  0:52 [PATCH] HID: intel-ish-hid: fixes incorrect error handling Pan Bian
2018-12-07 14:23 ` Benjamin Tissoires
2018-12-09 20:45   ` Jiri Kosina
2018-12-10  3:20     ` Srinivas Pandruvada
2018-12-17 14:05 ` Jiri Kosina

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).