[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1537103622-63482-1-git-send-email-zhongjiang@huawei.com>
Date: Sun, 16 Sep 2018 21:13:42 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <davem@...emloft.net>
CC: <fugang.duan@....com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] net: ethernet: remove redundant null pointer check before of_node_put
of_node_put has taken the null pinter check into account. So it is
safe to remove the duplicated check before of_node_put.
Signed-off-by: zhong jiang <zhongjiang@...wei.com>
---
drivers/net/ethernet/freescale/fec_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 2708297..67d6c9d 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2055,8 +2055,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;
--
1.7.12.4
Powered by blists - more mailing lists