kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe()
@ 2022-09-22 11:21 Dan Carpenter
  2022-09-23  8:58 ` Roger Quadros
  2022-09-24  6:29 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2022-09-22 11:21 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Roger Quadros, Jyri Sarha
  Cc: Vinod Koul, Vignesh Raghavendra, Siddharth Vadapalli,
	Tanmay Patil, linux-phy, kernel-janitors

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 <dan.carpenter@oracle.com>
---
 drivers/phy/ti/phy-j721e-wiz.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
index 20af142580ad..438ccce3d1bf 100644
--- a/drivers/phy/ti/phy-j721e-wiz.c
+++ b/drivers/phy/ti/phy-j721e-wiz.c
@@ -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;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe()
  2022-09-22 11:21 [PATCH] phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe() Dan Carpenter
@ 2022-09-23  8:58 ` Roger Quadros
  2022-09-24  6:29 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Roger Quadros @ 2022-09-23  8:58 UTC (permalink / raw)
  To: Dan Carpenter, Kishon Vijay Abraham I, Jyri Sarha
  Cc: Vinod Koul, Vignesh Raghavendra, Siddharth Vadapalli,
	Tanmay Patil, linux-phy, kernel-janitors



On 22/09/2022 14:21, Dan Carpenter wrote:
> 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 <dan.carpenter@oracle.com>

Reviewed-by: Roger Quadros <rogerq@kernel.org>

> ---
>  drivers/phy/ti/phy-j721e-wiz.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c
> index 20af142580ad..438ccce3d1bf 100644
> --- a/drivers/phy/ti/phy-j721e-wiz.c
> +++ b/drivers/phy/ti/phy-j721e-wiz.c
> @@ -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;

cheers,
-roger

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe()
  2022-09-22 11:21 [PATCH] phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe() Dan Carpenter
  2022-09-23  8:58 ` Roger Quadros
@ 2022-09-24  6:29 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2022-09-24  6:29 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Kishon Vijay Abraham I, Roger Quadros, Jyri Sarha,
	Vignesh Raghavendra, Siddharth Vadapalli, Tanmay Patil,
	linux-phy, kernel-janitors

On 22-09-22, 14:21, Dan Carpenter wrote:
> These two error paths need to call of_node_put(child_node) before
> returning.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-24  6:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 11:21 [PATCH] phy: ti: phy-j721e-wiz: fix reference leaks in wiz_probe() Dan Carpenter
2022-09-23  8:58 ` Roger Quadros
2022-09-24  6:29 ` 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).