Message ID | 20220310015313.14938-1-linmq006@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 2ac5b58e645c66932438bb021cb5b52097ce70b0 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] gianfar: ethtool: Fix refcount leak in gfar_get_ts_info | expand |
> -----Original Message----- > From: Miaoqian Lin <linmq006@gmail.com> > Sent: Thursday, March 10, 2022 3:53 AM > To: Claudiu Manoil <claudiu.manoil@nxp.com>; David S. Miller > <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Y.B. Lu > <yangbo.lu@nxp.com>; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org > Cc: linmq006@gmail.com > Subject: [PATCH net v2] gianfar: ethtool: Fix refcount leak in gfar_get_ts_info > > 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: 7349a74ea75c ("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> > --- > changes in v2: > - Fix the subject > --- Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Hello: This patch was applied to netdev/net.git (master) by Jakub Kicinski <kuba@kernel.org>: On Thu, 10 Mar 2022 01:53:13 +0000 you wrote: > 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: 7349a74ea75c ("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> > > [...] Here is the summary with links: - [net,v2] gianfar: ethtool: Fix refcount leak in gfar_get_ts_info https://git.kernel.org/netdev/net/c/2ac5b58e645c You are awesome, thank you!
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index ff756265d58f..9a2c16d69e2c 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -1464,6 +1464,7 @@ static int gfar_get_ts_info(struct net_device *dev, ptp_node = of_find_compatible_node(NULL, NULL, "fsl,etsec-ptp"); 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); }