All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Lv Ruyi <lv.ruyi@zte.com.cn>, Zeal Robot <zealci@zte.com.cn>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	madalin.bucur@nxp.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.10 11/18] dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info()
Date: Tue, 19 Apr 2022 14:13:45 -0400	[thread overview]
Message-ID: <20220419181353.485719-11-sashal@kernel.org> (raw)
In-Reply-To: <20220419181353.485719-1-sashal@kernel.org>

From: Lv Ruyi <lv.ruyi@zte.com.cn>

[ 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: 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 8 ++++++--
 1 file 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 1268996b7030..2f9075429c43 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);
-- 
2.35.1


  parent reply	other threads:[~2022-04-19 18:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 18:13 [PATCH AUTOSEL 5.10 01/18] ARM: vexpress/spc: Avoid negative array index when !SMP Sasha Levin
2022-04-19 18:13 ` Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 02/18] reset: tegra-bpmp: Restore Handle errors in BPMP response Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 03/18] platform/x86: samsung-laptop: Fix an unsigned comparison which can never be negative Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 04/18] ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant Sasha Levin
2022-04-19 18:13   ` Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 05/18] arm64: dts: imx: Fix imx8*-var-som touchscreen property sizes Sasha Levin
2022-04-19 18:13   ` Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 06/18] vxlan: fix error return code in vxlan_fdb_append Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 07/18] cifs: Check the IOCB_DIRECT flag, not O_DIRECT Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 08/18] net: atlantic: Avoid out-of-bounds indexing Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 09/18] mt76: Fix undefined behavior due to shift overflowing the constant Sasha Levin
2022-04-19 18:13   ` Sasha Levin
2022-04-19 18:13   ` Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 10/18] brcmfmac: sdio: " Sasha Levin
2022-04-19 18:13 ` Sasha Levin [this message]
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 12/18] drm/msm/mdp5: check the return of kzalloc() Sasha Levin
2022-04-19 18:13   ` Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 13/18] drm/msm: Stop using iommu_present() Sasha Levin
2022-04-19 18:13   ` Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 14/18] net: macb: Restart tx only if queue pointer is lagging Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 15/18] scsi: qedi: Fix failed disconnect handling Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 16/18] stat: fix inconsistency between struct stat and struct compat_stat Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 17/18] nvme: add a quirk to disable namespace identifiers Sasha Levin
2022-04-19 18:13 ` [PATCH AUTOSEL 5.10 18/18] nvme-pci: disable namespace identifiers for Qemu controllers Sasha Levin
2022-04-20 18:52   ` Luis Chamberlain
2022-04-25  0:49     ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220419181353.485719-11-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.ruyi@zte.com.cn \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.