lkml.org 
[lkml]   [2018]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] HID: intel-ish-hid: fixes incorrect error handling
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
>
>

\
 
 \ /
  Last update: 2018-12-07 15:23    [W:0.070 / U:4.816 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site