From: Suzuki K Poulose <Suzuki.Poulose@arm.com>
To: John Keeping <john@metanate.com>, Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: configs: plug memory leak
Date: Tue, 28 Feb 2017 13:54:56 +0000 [thread overview]
Message-ID: <35f3e080-f3b8-be4a-4304-335fe4d15cae@arm.com> (raw)
In-Reply-To: <20170228105530.5485-1-john@metanate.com>
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
prev parent reply other threads:[~2017-02-28 14:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 10:55 John Keeping
2017-02-28 13:54 ` Suzuki K Poulose [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35f3e080-f3b8-be4a-4304-335fe4d15cae@arm.com \
--to=suzuki.poulose@arm.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=john@metanate.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®