From: Greg KH <gregkh@linuxfoundation.org>
To: Zilin Guan <zilin@seu.edu.cn>
Cc: mathias.nyman@intel.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, jianhao.xu@seu.edu.cn
Subject: Re: [PATCH] usb: xhci: Fix memory leak in xchi_disable_slot()
Date: Wed, 7 Jan 2026 16:04:43 +0100 [thread overview]
Message-ID: <2026010723-earshot-staining-6e11@gregkh> (raw)
In-Reply-To: <20251225162119.1184703-1-zilin@seu.edu.cn>
On Thu, Dec 25, 2025 at 04:21:19PM +0000, Zilin Guan wrote:
> xhci_alloc_command() allocates a command structure and, when the
> second argument is true, also allocates a completion structure.
> Currently, the error handling path in xhci_disable_slot() only frees
> the command structure using kfree(), causing the completion structure
> to leak.
>
> Fix this by using xhci_free_command() instead of kfree(). This function
> correctly frees both the command and the completion structure.
>
> Fixes: cd3f1790b006d ("usb: xhci: Fix potential memory leak in xhci_disable_slot()")
No cc: stable?
And how was this found? How was it tested? What tool created this fix?
thanks,
greg k-h
next prev parent reply other threads:[~2026-01-07 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-25 16:21 [PATCH] usb: xhci: Fix memory leak in xchi_disable_slot() Zilin Guan
2026-01-07 15:04 ` Greg KH [this message]
2026-01-08 2:37 ` Zilin Guan
2026-01-08 5:42 ` Greg KH
2026-01-08 9:05 ` Zilin Guan
2026-01-08 9:15 ` Greg KH
2026-01-08 9:48 ` Zilin Guan
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=2026010723-earshot-staining-6e11@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jianhao.xu@seu.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=zilin@seu.edu.cn \
/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