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

Commit 80b188da authored by Lv Ruyi's avatar Lv Ruyi Committed by Greg Kroah-Hartman
Browse files

dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info()



[ Upstream commit 1a7eb80d170c28be2928433702256fe2a0bd1e0f ]

Both of of_get_parent() and of_parse_phandle() return node pointer with
refcount incremented, use of_node_put() on it to decrease refcount
when done.

Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarLv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 46f9fa0a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -506,11 +506,15 @@ static int dpaa_get_ts_info(struct net_device *net_dev,
	info->phc_index = -1;

	fman_node = of_get_parent(mac_node);
	if (fman_node)
	if (fman_node) {
		ptp_node = of_parse_phandle(fman_node, "ptimer-handle", 0);
		of_node_put(fman_node);
	}

	if (ptp_node)
	if (ptp_node) {
		ptp_dev = of_find_device_by_node(ptp_node);
		of_node_put(ptp_node);
	}

	if (ptp_dev)
		ptp = platform_get_drvdata(ptp_dev);