public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Zilin Guan <zilin@seu.edu.cn>
Cc: jianhao.xu@seu.edu.cn, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, mathias.nyman@intel.com
Subject: Re: [PATCH] usb: xhci: Fix memory leak in xchi_disable_slot()
Date: Thu, 8 Jan 2026 06:42:51 +0100	[thread overview]
Message-ID: <2026010804-commuting-hardly-0204@gregkh> (raw)
In-Reply-To: <20260108023710.539893-1-zilin@seu.edu.cn>

On Thu, Jan 08, 2026 at 02:37:10AM +0000, Zilin Guan wrote:
> On Wed, Jan 07, 2026 at 04:04:43PM +0100, Greg KH wrote:
> > 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?
> 
> My understanding is that the Cc: stable tag is primarily intended for 
> severe bugs. I wasn't sure if this leak was critical enough to warrant 
> backporting, especially since the amount of leaked memory is small. I 
> decided to avoid adding unnecessary noise to the stable tree, but I am 
> happy to include the tag if you advise doing so.
> 
> > And how was this found?  How was it tested?  
> 
> This issue was reported by our static analysis tool, but we manually verify 
> the bugs.

As per our documentation, you need to describe the tool being used,
please read and follow that, otherwise we have no idea of what is
happening here.

thanks,

greg k-h

  reply	other threads:[~2026-01-08  5:42 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
2026-01-08  2:37   ` Zilin Guan
2026-01-08  5:42     ` Greg KH [this message]
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=2026010804-commuting-hardly-0204@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