linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethernet: Fix error handling in xemaclite_of_probe
@ 2022-03-08  2:47 Miaoqian Lin
  2022-03-08 13:15 ` Andrew Lunn
  2022-03-09  6:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Miaoqian Lin @ 2022-03-08  2:47 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Michal Simek, Arnd Bergmann,
	Andrew Lunn, Miaoqian Lin, Michael Walle, Lad Prabhakar,
	YueHaibing, John Linn, Grant Likely, Sadanand Mutyala, netdev,
	linux-arm-kernel, linux-kernel

This node pointer is returned by of_parse_phandle() with refcount
incremented in this function. Calling of_node_put() to avoid the
refcount leak. As the remove function do.

Fixes: 5cdaaa12866e ("net: emaclite: adding MDIO and phy lib support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/net/ethernet/xilinx/xilinx_emaclite.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 519599480b15..77fa2cb03aca 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1183,7 +1183,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
 	if (rc) {
 		dev_err(dev,
 			"Cannot register network device, aborting\n");
-		goto error;
+		goto put_node;
 	}
 
 	dev_info(dev,
@@ -1191,6 +1191,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
 		 (unsigned long __force)ndev->mem_start, lp->base_addr, ndev->irq);
 	return 0;
 
+put_node:
+	of_node_put(lp->phy_node);
 error:
 	free_netdev(ndev);
 	return rc;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ethernet: Fix error handling in xemaclite_of_probe
  2022-03-08  2:47 [PATCH] ethernet: Fix error handling in xemaclite_of_probe Miaoqian Lin
@ 2022-03-08 13:15 ` Andrew Lunn
  2022-03-09  6:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-03-08 13:15 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: David S. Miller, Jakub Kicinski, Michal Simek, Arnd Bergmann,
	Michael Walle, Lad Prabhakar, YueHaibing, John Linn, Grant Likely,
	Sadanand Mutyala, netdev, linux-arm-kernel, linux-kernel

On Tue, Mar 08, 2022 at 02:47:49AM +0000, Miaoqian Lin wrote:
> This node pointer is returned by of_parse_phandle() with refcount
> incremented in this function. Calling of_node_put() to avoid the
> refcount leak. As the remove function do.
> 
> Fixes: 5cdaaa12866e ("net: emaclite: adding MDIO and phy lib support")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ethernet: Fix error handling in xemaclite_of_probe
  2022-03-08  2:47 [PATCH] ethernet: Fix error handling in xemaclite_of_probe Miaoqian Lin
  2022-03-08 13:15 ` Andrew Lunn
@ 2022-03-09  6:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-09  6:20 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: davem, kuba, michal.simek, arnd, andrew, michael,
	prabhakar.mahadev-lad.rj, yuehaibing, john.linn, grant.likely,
	Sadanand.Mutyala, netdev, linux-arm-kernel, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue,  8 Mar 2022 02:47:49 +0000 you wrote:
> This node pointer is returned by of_parse_phandle() with refcount
> incremented in this function. Calling of_node_put() to avoid the
> refcount leak. As the remove function do.
> 
> Fixes: 5cdaaa12866e ("net: emaclite: adding MDIO and phy lib support")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> 
> [...]

Here is the summary with links:
  - ethernet: Fix error handling in xemaclite_of_probe
    https://git.kernel.org/netdev/net/c/b19ab4b38b06

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08  2:47 [PATCH] ethernet: Fix error handling in xemaclite_of_probe Miaoqian Lin
2022-03-08 13:15 ` Andrew Lunn
2022-03-09  6:20 ` patchwork-bot+netdevbpf

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).