netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Simon Horman <horms@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	yisen.zhuang@huawei.com, salil.mehta@huawei.com,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	shaojijie@huawei.com, wojciech.drewek@intel.com,
	liuyonglong@huawei.com, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 6.10 013/197] net: hisilicon: hns_dsaf_mac: fix OF node leak in hns_mac_get_info()
Date: Wed, 25 Sep 2024 07:50:32 -0400	[thread overview]
Message-ID: <20240925115823.1303019-13-sashal@kernel.org> (raw)
In-Reply-To: <20240925115823.1303019-1-sashal@kernel.org>

From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

[ Upstream commit 5680cf8d34e1552df987e2f4bb1bff0b2a8c8b11 ]

Driver is leaking OF node reference from
of_parse_phandle_with_fixed_args() in hns_mac_get_info().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240827144421.52852-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index f75668c479351..616a2768e5048 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -933,6 +933,7 @@ static int hns_mac_get_info(struct hns_mac_cb *mac_cb)
 			mac_cb->cpld_ctrl = NULL;
 		} else {
 			syscon = syscon_node_to_regmap(cpld_args.np);
+			of_node_put(cpld_args.np);
 			if (IS_ERR_OR_NULL(syscon)) {
 				dev_dbg(mac_cb->dev, "no cpld-syscon found!\n");
 				mac_cb->cpld_ctrl = NULL;
-- 
2.43.0


  parent reply	other threads:[~2024-09-25 11:59 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240925115823.1303019-1-sashal@kernel.org>
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 007/197] ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node() Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 010/197] wifi: cfg80211: Set correct chandef when starting CAC Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 011/197] net/xen-netback: prevent UAF in xenvif_flush_hash() Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 012/197] net: hisilicon: hip04: fix OF node leak in probe() Sasha Levin
2024-09-25 11:50 ` Sasha Levin [this message]
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 014/197] net: hisilicon: hns_mdio: " Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 019/197] e1000e: avoid failing the system during pm_suspend Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 022/197] net: sched: consistently use rcu_replace_pointer() in taprio_change() Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 032/197] l2tp: don't use tunnel socket sk_user_data in ppp procfs output Sasha Levin
2024-09-25 14:12   ` James Chapman
2024-10-06  0:30     ` Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 035/197] tipc: guard against string buffer overrun Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 036/197] net: mvpp2: Increase size of queue_name buffer Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 037/197] bnxt_en: Extend maximum length of version string by 1 byte Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 038/197] ipv4: Check !in_dev earlier for ioctl(SIOCSIFADDR) Sasha Levin
2024-09-25 11:50 ` [PATCH AUTOSEL 6.10 040/197] netfilter: nf_tables: don't initialize registers in nft_do_chain() Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 041/197] ipv4: Mask upper DSCP bits and ECN bits in NETLINK_FIB_LOOKUP family Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 045/197] net: atlantic: Avoid warning about potential string truncation Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 047/197] netpoll: Ensure clean state on setup failures Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 048/197] tcp: avoid reusing FIN_WAIT2 when trying to find port in connect() process Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 052/197] wifi: mac80211: fix RCU list iterations Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 056/197] can: netlink: avoid call to do_set_data_bittiming callback with stale can_priv::ctrlmode Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 057/197] netdev-genl: Set extack and fix error on napi-get Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 060/197] net: phy: Check for read errors in SIOCGMIIREG Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 064/197] net: napi: Prevent overflow of napi_defer_hard_irqs Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 069/197] net: tls: wait for async completion on last message Sasha Levin
2024-09-25 11:51 ` [PATCH AUTOSEL 6.10 072/197] nfp: Use IRQF_NO_AUTOEN flag in request_irq() 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=20240925115823.1303019-13-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=salil.mehta@huawei.com \
    --cc=shaojijie@huawei.com \
    --cc=stable@vger.kernel.org \
    --cc=wojciech.drewek@intel.com \
    --cc=yisen.zhuang@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).