[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025121757-hazelnut-oxymoron-19ed@gregkh>
Date: Wed, 17 Dec 2025 14:22:08 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: stern@...land.harvard.edu, linux-usb@...r.kernel.org,
linux-omap@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] USB: ehci-omap: Fix missing usb_phy_init() error
handling
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@...land.harvard.edu>
> Signed-off-by: Haotian Zhang <vulab@...as.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
Powered by blists - more mailing lists