Skip to content

Commit 21044e6

Browse files
Yuuoniygregkh
authored andcommitted
gianfar: ethtool: Fix refcount leak in gfar_get_ts_info
[ Upstream commit 2ac5b58 ] The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: 7349a74 ("net: ethernet: gianfar_ethtool: get phc index through drvdata") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com> Link: https://lore.kernel.org/r/20220310015313.14938-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3a4cd1c commit 21044e6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/freescale/gianfar_ethtool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,7 @@ static int gfar_get_ts_info(struct net_device *dev,
14561456
ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp");
14571457
if (ptp_node) {
14581458
ptp_dev = of_find_device_by_node(ptp_node);
1459+
of_node_put(ptp_node);
14591460
if (ptp_dev)
14601461
ptp = platform_get_drvdata(ptp_dev);
14611462
}

0 commit comments

Comments
 (0)