phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe()
Subsystems (2)
PATCH 1/1 phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe()
These two error paths need to call of_node_put(child_node) before returning.
Fixes edd473d4293a ("phy: ti: phy-j721e-wiz: add support for j7200-wiz-10g")
Fixes 7ae14cf581f2 ("phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/phy/ti/phy-j721e-wiz.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/phy/ti/phy-j721e-wiz.c +3 -2
@@ -1400,7 +1400,8 @@ static int wiz_probe(struct platform_device *pdev)if (IS_ERR (wiz->scm_regmap)) {if (wiz->type ==J7200_WIZ_10G ) {dev_err (dev,"Couldn't get ti,scm regmap\n" ); -return -ENODEV ; + ret = -ENODEV ; + goto err_addr_to_resource; } wiz->scm_regmap =NULL ;
@@ -1450,7 +1451,7 @@ static int wiz_probe(struct platform_device *pdev) ret =wiz_get_lane_phy_types (dev, wiz);if (ret) -return ret; + goto err_addr_to_resource; wiz->dev = dev; wiz->regmap = regmap;
Signature · 7 lines
2.35.1 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 6 lines · Dan Carpenter
These two error paths need to call
of_node_put(child_node)before returning.Fixes edd473d4293a ("phy: ti: phy-j721e-wiz: add support for j7200-wiz-10g")Fixes 7ae14cf581f2 ("phy: ti: j721e-wiz: Implement DisplayPort mode to the wiz driver")Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by Roger Quadros <[email protected]>
Quoted 19 lines
--- drivers/phy/ti/phy-j721e-wiz.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/phy/ti/phy-j721e-wiz.c +2
-1@@ -1400,7 +1400,8 @@ static int wiz_probe(struct platform_device *pdev)if (IS_ERR (wiz->scm_regmap)) {if (wiz->type ==J7200_WIZ_10G ) {dev_err (dev,"Couldn't get ti,scm regmap\n" ); -return -ENODEV ; + ret = -ENODEV ; + goto err_addr_to_resource; } wiz->scm_regmap =NULL ;
drivers/phy/ti/phy-j721e-wiz.c static int wiz_probe(struct platform_device *pdev) · line 1457
Quoted 8 lines
drivers/phy/ti/phy-j721e-wiz.c +1
-1@@ -1450,7 +1451,7 @@ static int wiz_probe(struct platform_device *pdev) ret =wiz_get_lane_phy_types (dev, wiz);if (ret) -return ret; + goto err_addr_to_resource; wiz->dev = dev; wiz->regmap = regmap;
cheers,
-roger
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Quoted 2 lines · Dan Carpenter
These two error paths need to call
of_node_put(child_node)before returning.
Applied, thanks
Signature · 1 line
~Vinod