Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2e45406 authored by Peter Chen's avatar Peter Chen Committed by David S. Miller
Browse files

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: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 46997066
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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;