ethernet: marvell: mvpp2: add missing of_node_put after calling of_parse_phandle
authorPeter Chen <peter.chen@nxp.com>
Mon, 1 Aug 2016 07:02:37 +0000 (15:02 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Aug 2016 04:43:48 +0000 (21:43 -0700)
of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c

index 0b047178cda1107fc28bb55396d97ee7818b41fc..60227a3452a40d00014a2f7d5584f3b518785455 100644 (file)
@@ -6234,6 +6234,7 @@ err_free_stats:
 err_free_irq:
        irq_dispose_mapping(port->irq);
 err_free_netdev:
+       of_node_put(phy_node);
        free_netdev(dev);
        return err;
 }
@@ -6244,6 +6245,7 @@ static void mvpp2_port_remove(struct mvpp2_port *port)
        int i;
 
        unregister_netdev(port->dev);
+       of_node_put(port->phy_node);
        free_percpu(port->pcpu);
        free_percpu(port->stats);
        for (i = 0; i < txq_number; i++)