lkml.org 
[lkml]   [2017]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb: misc: legousbtower: Fix memory leak
Hi,

On Thu, May 04, 2017 at 10:51:52PM +0300, Maksim Salau wrote:
> get_version_reply is not freed if function returns with success.
> Memory leak was introduced by commit 942a48730faf149ccbf3e12ac718aee120bb3529

Pointing the commit like that is probable fine, but you should also
use "Fixes" tag:

Fixes: 942a48730faf ("usb: misc: legousbtower: Fix buffers on stack")

Please check Documentation/process/submitting-patches.rst for more
information.

> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

You are signing the patch for me which you should not be doing in this
case. More appropriate tag would be for example "Suggested-by" or
something like that. There is more information about this too in
Documentation/process/submitting-patches.rst


> Signed-off-by: Maksim Salau <maksim.salau@gmail.com>
> ---
> drivers/usb/misc/legousbtower.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
> index aa3c280..0782ac6 100644
> --- a/drivers/usb/misc/legousbtower.c
> +++ b/drivers/usb/misc/legousbtower.c
> @@ -926,6 +926,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
> USB_MAJOR, dev->minor);
>
> exit:
> + kfree(get_version_reply);
> return retval;
>
> error:
> --
> 2.9.3


Thanks,

--
heikki

\
 
 \ /
  Last update: 2017-05-05 09:33    [W:6.658 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site