linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: "qiang.zhang@windriver.com" <qiang.zhang@windriver.com>
Cc: "balbi@kernel.org" <balbi@kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: function: printer: Fix a memory leak for interface descriptor
Date: Wed, 9 Dec 2020 13:45:41 +0000	[thread overview]
Message-ID: <20201209134512.GA1598@b29397-desktop> (raw)
In-Reply-To: <20201209030018.6001-1-qiang.zhang@windriver.com>

On 20-12-09 11:00:18, qiang.zhang@windriver.com wrote:
> From: Zqiang <qiang.zhang@windriver.com>
> 
> When printer driver be load, the printer_func_bind function be called, in
		      is loaded				      is called

> this function, the interface descriptor be allocated memory, if after that,
				descriptors memory region are allocated
> the error occurred, the interface descriptor memory need to be free.
		occurs,			

Except Typo, otherwise:
Reviewed-by: Peter Chen <peter.chen@nxp.com>

Besides, it is bug-fix, you could add fixes tag, and cc stable@vger.kernel.org.

Peter

> 
> Signed-off-by: Zqiang <qiang.zhang@windriver.com>
> ---
>  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);
>  	return ret;
>  
>  }
> -- 
> 2.17.1
> 

-- 

Thanks,
Peter Chen

      reply	other threads:[~2020-12-09 13:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09  3:00 [PATCH] usb: gadget: function: printer: Fix a memory leak for interface descriptor qiang.zhang
2020-12-09 13:45 ` Peter Chen [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=20201209134512.GA1598@b29397-desktop \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.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
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;
as well as URLs for NNTP newsgroup(s).