diff options
| author | Miaoqian Lin <linmq006@gmail.com> | 2022-03-08 02:47:49 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-03-16 12:57:06 +0100 |
| commit | b7220f8e9d6c6b9594ddfb3125dad938cd478b1f (patch) | |
| tree | 93752101c9a61d0082d8ea1a79236f87334bae15 | |
| parent | d7ba28a3902c1e0b228ae0c862989f65733a50e8 (diff) | |
| download | linux-b7220f8e9d6c6b9594ddfb3125dad938cd478b1f.tar.gz linux-b7220f8e9d6c6b9594ddfb3125dad938cd478b1f.tar.bz2 linux-b7220f8e9d6c6b9594ddfb3125dad938cd478b1f.zip | |
ethernet: Fix error handling in xemaclite_of_probe
[ Upstream commit b19ab4b38b06aae12442b2de95ccf58b5dc53584 ]
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>
Link: https://lore.kernel.org/r/20220308024751.2320-1-linmq006@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/net/ethernet/xilinx/xilinx_emaclite.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 5261796ce708..d83e6743f156 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -1161,7 +1161,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, @@ -1169,6 +1169,8 @@ static int xemaclite_of_probe(struct platform_device *ofdev) (unsigned int __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; |
