From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Pan Bian <bianpan2016@163.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] usb: dwc2: fix potential double free
Date: Thu, 14 Nov 2019 09:49:09 +0000 [thread overview]
Message-ID: <5baaa3ab-fe75-4351-5acc-ec7fdffce28b@synopsys.com> (raw)
In-Reply-To: <1573005273-35877-1-git-send-email-bianpan2016@163.com>
On 11/6/2019 5:54 AM, Pan Bian wrote:
> The member hsotg->desc_gen_cache is assigned NULL after it is destroyed
> to avoid being freed twice when the call to usb_add_hcd() fails.
>
> Fixes: 3b5fcc9ac2f4 ("usb: dwc2: host: use kmem cache to allocate descriptors")
>
> Signed-off-by: Pan Bian <bianpan2016@163.com>
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
> ---
> drivers/usb/dwc2/hcd.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
> index 81afe553aa66..3b943352b296 100644
> --- a/drivers/usb/dwc2/hcd.c
> +++ b/drivers/usb/dwc2/hcd.c
> @@ -5183,6 +5183,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
> "unable to create dwc2 hs isoc desc cache\n");
>
> kmem_cache_destroy(hsotg->desc_gen_cache);
> + hsotg->desc_gen_cache = NULL;
>
> /*
> * Disable descriptor dma mode since it will not be
>
prev parent reply other threads:[~2019-11-14 9:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 1:54 [PATCH 1/1] usb: dwc2: fix potential double free Pan Bian
2019-11-14 9:49 ` Minas Harutyunyan [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=5baaa3ab-fe75-4351-5acc-ec7fdffce28b@synopsys.com \
--to=minas.harutyunyan@synopsys.com \
--cc=bianpan2016@163.com \
--cc=gregkh@linuxfoundation.org \
--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;
as well as URLs for NNTP newsgroup(s).