提交 b19ab4b3 编写于 作者: M Miaoqian Lin 提交者: Jakub Kicinski

ethernet: Fix error handling in xemaclite_of_probe

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: 5cdaaa12 ("net: emaclite: adding MDIO and phy lib support")
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220308024751.2320-1-linmq006@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 e5417cbf
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册