[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <35f3e080-f3b8-be4a-4304-335fe4d15cae@arm.com>
Date: Tue, 28 Feb 2017 13:54:56 +0000
From: Suzuki K Poulose <Suzuki.Poulose@....com>
To: John Keeping <john@...anate.com>, Felipe Balbi <balbi@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: configs: plug memory leak
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@...anate.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
Powered by blists - more mailing lists