summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2016-08-01 15:02:34 +0800
committerDavid S. Miller <davem@davemloft.net>2016-08-01 21:43:48 -0700
commitb2e45406e7b789f54769eefdaf681335ef17cfb0 (patch)
tree5cdc0949f4f9211772cc226ff1bfd185fea59d45 /drivers/net/ethernet/hisilicon
parent46997066ffed342166b49ed8ebb76eb40b2f2b24 (diff)
downloadlinux-b2e45406e7b789f54769eefdaf681335ef17cfb0.tar.bz2
ethernet: hisilicon: hns: hns_dsaf_mac: add missing of_node_put after calling of_parse_phandle
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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 3fb87e233c49..5c8afe1a5ccb 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -795,6 +795,7 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
mac_cb->mac_id, np->name);
}
+ of_node_put(np);
return 0;
}
@@ -812,10 +813,12 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
dev_dbg(mac_cb->dev, "mac%d phy_node: %s\n",
mac_cb->mac_id, np->name);
}
+ of_node_put(np);
- syscon = syscon_node_to_regmap(
- of_parse_phandle(to_of_node(mac_cb->fw_port),
- "serdes-syscon", 0));
+ np = of_parse_phandle(to_of_node(mac_cb->fw_port),
+ "serdes-syscon", 0);
+ syscon = syscon_node_to_regmap(np);
+ of_node_put(np);
if (IS_ERR_OR_NULL(syscon)) {
dev_err(mac_cb->dev, "serdes-syscon is needed!\n");
return -EINVAL;