net: qcom/emac: Add missing of_node_put()
authorYueHaibing <yuehaibing@huawei.com>
Mon, 11 Jun 2018 13:03:45 +0000 (21:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jun 2018 00:01:05 +0000 (17:01 -0700)
Add missing of_node_put() call for device node returned by
of_parse_phandle().

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/emac/emac-sgmii.c

index e78e5db394589674e981bc802a09bdf918c3183c..c694e3428dfc4706a0b4652271211b1145d8110e 100644 (file)
@@ -384,6 +384,7 @@ int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt)
                }
 
                sgmii_pdev = of_find_device_by_node(np);
                }
 
                sgmii_pdev = of_find_device_by_node(np);
+               of_node_put(np);
                if (!sgmii_pdev) {
                        dev_err(&pdev->dev, "invalid internal-phy property\n");
                        return -ENODEV;
                if (!sgmii_pdev) {
                        dev_err(&pdev->dev, "invalid internal-phy property\n");
                        return -ENODEV;