From: Greg KH <gregkh@linuxfoundation.org>
To: Haotian Zhang <vulab@iscas.ac.cn>
Cc: stern@rowland.harvard.edu, linux-usb@vger.kernel.org,
linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] USB: ehci-omap: Fix missing usb_phy_init() error handling
Date: Wed, 17 Dec 2025 14:22:08 +0100 [thread overview]
Message-ID: <2025121757-hazelnut-oxymoron-19ed@gregkh> (raw)
In-Reply-To: <20251203034741.461-1-vulab@iscas.ac.cn>
On Wed, Dec 03, 2025 at 11:28:22AM +0800, Haotian Zhang wrote:
> usb_phy_init() may fail if the PHY clock or regulator setup fails,
> but ehci_hcd_omap_probe() does not check its return value,
> potentially causing later operations to act on an uninitialized PHY.
> Original cleanup also calls usb_phy_shutdown() on uninitialized
> PHYs, which is unsafe.
>
> Add proper error checking for usb_phy_init() calls. Add a new
> error label to properly remove the hcd. Use local bool array to
> track successfully initialized PHYs, only shutdown properly
> initialized PHYs during cleanup.
>
> Fixes: 4e5c9e6fa2d2 ("USB: ehci-omap: Tweak PHY initialization sequence")
> Fixes: 49f092198f4f ("USB: ehci-omap: Fix detection in HSIC mode")
> Suggested-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---
> Changes in v2:
> -Add a local bool array to track successfully initialized PHYs.
> -Check if PHY is successfully initialized before
> calling usb_phy_shutdown().
> ---
> drivers/usb/host/ehci-omap.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
Again, how was this found and tested?
thanks,
greg k-h
prev parent reply other threads:[~2025-12-17 13:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 8:00 [PATCH] USB: ehci-omap: Fix missing usb_phy_init() error handling Haotian Zhang
2025-12-02 8:30 ` Greg KH
2025-12-02 16:05 ` Alan Stern
2025-12-03 3:28 ` [PATCH v2] " Haotian Zhang
2025-12-17 13:22 ` Greg KH [this message]
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=2025121757-hazelnut-oxymoron-19ed@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--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