[PATCH v4 3/6] phy: core: Fix that API devm_phy_destroy() fails to destroy the phy
Johan Hovold
johan at kernel.org
Tue Nov 5 09:17:33 PST 2024
On Sat, Nov 02, 2024 at 11:53:45AM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu at quicinc.com>
>
> For devm_phy_destroy(), its comment says it needs to invoke phy_destroy()
> to destroy the phy, but it will not actually invoke the function since
> devres_destroy() does not call devm_phy_consume(), and the missing
> phy_destroy() call will case that the phy fails to be destroyed.
Should also have been split in two sentences, but this also works.
typo: s/case/cause/
> Fortunately, the faulty API has not been used by current kernel tree.
> Fixed by using devres_release() instead of devres_destroy() within the API.
>
> Fixes: ff764963479a ("drivers: phy: add generic PHY framework")
> Cc: stable at vger.kernel.org
> Signed-off-by: Zijun Hu <quic_zijuhu at quicinc.com>
Reviewed-by: Johan Hovold <johan+linaro at kernel.org>
More information about the linux-phy
mailing list