From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Jianglei Nie <niejianglei2021@163.com>,
mathias.nyman@intel.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info()
Date: Wed, 7 Sep 2022 14:42:24 +0300 [thread overview]
Message-ID: <5b38337c-6d39-de07-961c-e84eb05d5981@linux.intel.com> (raw)
In-Reply-To: <20220907074850.59693-1-niejianglei2021@163.com>
On 7.9.2022 10.48, Jianglei Nie wrote:
> xhci_alloc_stream_info() allocates stream context array for stream_info
> ->stream_ctx_array with xhci_alloc_stream_ctx(). When some error occurs,
> stream_info->stream_ctx_array is not released, which will lead to a
> memory leak.
>
> We can fix it by releasing the stream_info->stream_ctx_array with
> xhci_free_stream_ctx() on the error path to avoid the potential memory
> leak.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Thanks, good to get this fixed.
Adding to for-usb-next and skipping stable as hitting this path is mostly theoretical.
-Mathias
next prev parent reply other threads:[~2022-09-07 11:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 7:48 [PATCH] usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info() Jianglei Nie
2022-09-07 11:42 ` Mathias Nyman [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-06-30 1:10 Jianglei Nie
2022-06-30 6:48 ` Greg KH
2022-06-30 9:57 ` Mathias Nyman
2022-06-30 10:09 ` Mathias Nyman
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=5b38337c-6d39-de07-961c-e84eb05d5981@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=niejianglei2021@163.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