Skip to content

Commit 8502801

Browse files
Dan Carpentervinodkoul
authored andcommitted
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: 71e2f5c ("phy: ti: Add a new SERDES driver for TI's AM654x SoC") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20200905124648.GA183976@mwanda Signed-off-by: Vinod Koul <[email protected]>
1 parent ad7a7ac commit 8502801

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/phy/ti/phy-am654-serdes.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,10 @@ static int serdes_am654_probe(struct platform_device *pdev)
725725
pm_runtime_enable(dev);
726726

727727
phy = devm_phy_create(dev, NULL, &ops);
728-
if (IS_ERR(phy))
729-
return PTR_ERR(phy);
728+
if (IS_ERR(phy)) {
729+
ret = PTR_ERR(phy);
730+
goto clk_err;
731+
}
730732

731733
phy_set_drvdata(phy, am654_phy);
732734
phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);

0 commit comments

Comments
 (0)