lkml.org 
[lkml]   [2017]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] usb: gadget: configs: plug memory leak
From
Date
On 28/02/17 10:55, John Keeping wrote:
> When binding a gadget to a device, "name" is stored in gi->udc_name, but
> this does not happen when unregistering and the string is leaked.
>
> Signed-off-by: John Keeping <john@metanate.com>
> ---
> drivers/usb/gadget/configfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
> index 78c44979dde3..cbff3b02840d 100644
> --- a/drivers/usb/gadget/configfs.c
> +++ b/drivers/usb/gadget/configfs.c
> @@ -269,6 +269,7 @@ static ssize_t gadget_dev_desc_UDC_store(struct config_item *item,
> ret = unregister_gadget(gi);
> if (ret)
> goto err;
> + kfree(name);

Looks correct to me.

Suzuki

\
 
 \ /
  Last update: 2017-02-28 15:06    [W:0.038 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site