* [PATCH] phy: ti: am654: Fix a leak in serdes_am654_probe()
@ 2020-09-05 12:46 Dan Carpenter
2020-09-08 10:53 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-09-05 12:46 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: Vinod Koul, Sekhar Nori, Roger Quadros, Rikard Falkeborn,
linux-kernel, kernel-janitors
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>
---
drivers/phy/ti/phy-am654-serdes.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c
index 6f3c11bd65d5..2ff56ce77b30 100644
--- a/drivers/phy/ti/phy-am654-serdes.c
+++ b/drivers/phy/ti/phy-am654-serdes.c
@@ -822,8 +822,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);
--
2.28.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] phy: ti: am654: Fix a leak in serdes_am654_probe()
2020-09-05 12:46 [PATCH] phy: ti: am654: Fix a leak in serdes_am654_probe() Dan Carpenter
@ 2020-09-08 10:53 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2020-09-08 10:53 UTC (permalink / raw)
To: Dan Carpenter
Cc: Kishon Vijay Abraham I, Sekhar Nori, Roger Quadros,
Rikard Falkeborn, linux-kernel, kernel-janitors
On 05-09-20, 15:46, Dan Carpenter wrote:
> If devm_phy_create() fails then we need to call of_clk_del_provider(node)
> to undo the call to of_clk_add_provider().
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-08 10:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-05 12:46 [PATCH] phy: ti: am654: Fix a leak in serdes_am654_probe() Dan Carpenter
2020-09-08 10:53 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).