public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Haotian Zhang <vulab@iscas.ac.cn>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: Fix missing typec_unregister_port on error paths
Date: Mon, 24 Nov 2025 13:29:07 +0100	[thread overview]
Message-ID: <2025112448-hangup-detonate-f46c@gregkh> (raw)
In-Reply-To: <20251124122030.1759-1-vulab@iscas.ac.cn>

On Mon, Nov 24, 2025 at 08:20:30PM +0800, Haotian Zhang wrote:
> The ucsi_register_port()  registers a Type-C port with
> typec_register_port(), but several error paths after a successful
> registration returned directly to cleanup without calling
> typec_unregister_port(). This lead to a potential resource leak.
> 
> Add a common error-unwind path that calls typec_unregister_port()
> for all failures to ensure proper cleanup.
> 
> Fixes: c1b0bc2dabfa ("usb: typec: Add support for UCSI interface")
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>

How was this found?

How was this tested?

thanks,

greg k-h

  reply	other threads:[~2025-11-24 12:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 12:20 [PATCH] usb: typec: ucsi: Fix missing typec_unregister_port on error paths Haotian Zhang
2025-11-24 12:29 ` Greg Kroah-Hartman [this message]
2025-11-25  8:27 ` Heikki Krogerus
2025-11-25  9:20 ` [PATCH v2] usb: typec: ucsi: Treat alt mode and status failures as non-fatal Haotian Zhang
2025-11-25 11:45   ` Greg Kroah-Hartman

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=2025112448-hangup-detonate-f46c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=vulab@iscas.ac.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