net: dsa: remove redundant null pointer check before of_node_put
authorzhong jiang <zhongjiang@huawei.com>
Sun, 16 Sep 2018 13:22:31 +0000 (21:22 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Sep 2018 15:20:11 +0000 (08:20 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2.c

index e0066ad..1fc27e1 100644 (file)
@@ -465,8 +465,7 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds)
 static void bcm_sf2_mdio_unregister(struct bcm_sf2_priv *priv)
 {
        mdiobus_unregister(priv->slave_mii_bus);
-       if (priv->master_mii_dn)
-               of_node_put(priv->master_mii_dn);
+       of_node_put(priv->master_mii_dn);
 }
 
 static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port)