Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Zqiang <qiang.zhang@windriver.com>
Cc: balbi@kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: function: printer: Fix usb function descriptors leak
Date: Wed, 14 Oct 2020 10:12:46 +0200
Message-ID: <20201014081246.GB3009479@kroah.com> (raw)
In-Reply-To: <20201014075523.15688-1-qiang.zhang@windriver.com>

On Wed, Oct 14, 2020 at 03:55:23PM +0800, Zqiang wrote:
> If an error occurs after call 'usb_assign_descriptors' func, the
> 'usb_free_all_descriptors' need to be call to release memory space
> occupied by function descriptors.
> 
> Signed-off-by: Zqiang <qiang.zhang@windriver.com>

Please use your ful name for the From: and signed-off-by lines, as the
documentation states is required.  If this is your full name, then why
does it not match the name on your email address from your employer?

> ---
>  drivers/usb/gadget/function/f_printer.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
> index 64a4112068fc..2f1eb2e81d30 100644
> --- a/drivers/usb/gadget/function/f_printer.c
> +++ b/drivers/usb/gadget/function/f_printer.c
> @@ -1162,6 +1162,7 @@ static int printer_func_bind(struct usb_configuration *c,
>  		printer_req_free(dev->in_ep, req);
>  	}
>  
> +	usb_free_all_descriptors(f);

What commit caused this problem?

thanks,

greg k-h

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  7:55 Zqiang
2020-10-14  8:12 ` Greg KH [this message]
2020-10-14  8:28 qiang.zhang

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=20201014081246.GB3009479@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=qiang.zhang@windriver.com \
    /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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git