summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-09-16 21:13:42 +0800
committerDavid S. Miller <davem@davemloft.net>2018-09-17 08:21:45 -0700
commita4ebec033e1cff2690806c1721189c51b1cd0ae5 (patch)
tree04fdc9a6791e3b16da333c5c4261aa6524017f36 /drivers/net/ethernet/freescale
parentb458925ed5797a20f22cdf005625e25106cf7124 (diff)
net: ethernet: remove redundant null pointer check before of_node_put
of_node_put has taken the null pointer check into account. So it is safe to remove the duplicated check before of_node_put. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 2e0bb90131b6..ce74b7a46d07 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2054,8 +2054,7 @@ static int fec_enet_mii_init(struct platform_device *pdev)
node = of_get_child_by_name(pdev->dev.of_node, "mdio");
err = of_mdiobus_register(fep->mii_bus, node);
- if (node)
- of_node_put(node);
+ of_node_put(node);
if (err)
goto err_out_free_mdiobus;