[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025112448-hangup-detonate-f46c@gregkh>
Date: Mon, 24 Nov 2025 13:29:07 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: Fix missing typec_unregister_port on
error paths
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@...as.ac.cn>
How was this found?
How was this tested?
thanks,
greg k-h
Powered by blists - more mailing lists