diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-09-05 14:46:48 +0200 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-09-08 12:53:09 +0200 |
commit | 850280156f6421a404f2351bee07a0e7bedfd4c6 (patch) | |
tree | 9afaf19c58f94e29fa9c2442957c1c4d18f79542 /drivers/phy | |
parent | phy: omap-usb2-phy: disable PHY charger detect (diff) | |
download | linux-850280156f6421a404f2351bee07a0e7bedfd4c6.tar.xz linux-850280156f6421a404f2351bee07a0e7bedfd4c6.zip |
phy: ti: am654: Fix a leak in serdes_am654_probe()
If devm_phy_create() fails then we need to call of_clk_del_provider(node)
to undo the call to of_clk_add_provider().
Fixes: 71e2f5c5c224 ("phy: ti: Add a new SERDES driver for TI's AM654x SoC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200905124648.GA183976@mwanda
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/ti/phy-am654-serdes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c index a174b3c3f010..819c49af169a 100644 --- a/drivers/phy/ti/phy-am654-serdes.c +++ b/drivers/phy/ti/phy-am654-serdes.c @@ -725,8 +725,10 @@ static int serdes_am654_probe(struct platform_device *pdev) pm_runtime_enable(dev); phy = devm_phy_create(dev, NULL, &ops); - if (IS_ERR(phy)) - return PTR_ERR(phy); + if (IS_ERR(phy)) { + ret = PTR_ERR(phy); + goto clk_err; + } phy_set_drvdata(phy, am654_phy); phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate); |