diff options
author | Lv Ruyi <lv.ruyi@zte.com.cn> | 2022-04-08 12:49:41 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-11 14:02:33 +0300 |
commit | 1a7eb80d170c28be2928433702256fe2a0bd1e0f (patch) | |
tree | bed6c6dd2e951da8464770ecdc586987a37be6eb /drivers | |
parent | e8a64bbaaad1f6548cec5508297bc6d45e8ab69e (diff) | |
download | linux-1a7eb80d170c28be2928433702256fe2a0bd1e0f.tar.xz |
dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info()
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: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c index 763d2c7b5fb1..5750f9a56393 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c @@ -489,11 +489,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); |