From: Zijun Hu Date: Sun, 20 Oct 2024 09:33:42 +0000 (+0800) Subject: usb: phy: Fix API devm_usb_put_phy() can not release the phy X-Git-Tag: v5.10.229~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efefde4d1b7c7c6e5058c3ec8b1a83fe8bd7a1d0;p=thirdparty%2Fkernel%2Fstable.git usb: phy: Fix API devm_usb_put_phy() can not release the phy commit fdce49b5da6e0fb6d077986dec3e90ef2b094b50 upstream. For devm_usb_put_phy(), its comment says it needs to invoke usb_put_phy() to release the phy, but it does not do that actually, so it can not fully undo what the API devm_usb_get_phy() does, that is wrong, fixed by using devres_release() instead of devres_destroy() within the API. Fixes: cedf8602373a ("usb: phy: move bulk of otg/otg.c to phy/phy.c") Cc: stable@vger.kernel.org Signed-off-by: Zijun Hu Link: https://lore.kernel.org/r/20241020-usb_phy_fix-v1-1-7f79243b8e1e@quicinc.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c index b47285f023cf7..5adbf7fd24fdb 100644 --- a/drivers/usb/phy/phy.c +++ b/drivers/usb/phy/phy.c @@ -590,7 +590,7 @@ void devm_usb_put_phy(struct device *dev, struct usb_phy *phy) { int r; - r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy); + r = devres_release(dev, devm_usb_phy_release, devm_usb_phy_match, phy); dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n"); } EXPORT_SYMBOL_GPL(devm_usb_put_phy);