From: Wentao Liang <vulab@iscas.ac.cn>
To: Alexander Aring <alex.aring@gmail.com>,
Stefan Schmidt <stefan@datenfreihafen.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH] ieee802154: drop the extra phy reference in del_iface
Date: Wed, 4 Nov 2026 02:28:09 +0000 [thread overview]
Message-ID: <20261104022809.1484165-1-vulab@iscas.ac.cn> (raw)
ieee802154_del_iface() takes a reference on the phy of the interface and
then looks up the phy named by IEEE802154_ATTR_PHY_NAME, which takes
another reference. When the optional attribute names the phy of the
interface being deleted, phy and phy2 are the same device, the lookup
reference is not dropped and the function later puts the phy only once.
Deleting an interface while passing its own phy name therefore leaks a
wpan_phy reference.
Put the lookup reference in the matching case as well, leaving only the
reference taken from the interface.
Fixes: bb1cafb8fc41 ("ieee802154: add support for creation/removal of logic interfaces")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
net/ieee802154/nl-phy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index 4c07a475c567..e7a8237b73c3 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -311,6 +311,8 @@ int ieee802154_del_iface(struct sk_buff *skb, struct genl_info *info)
wpan_phy_put(phy2);
goto out_dev;
}
+
+ wpan_phy_put(phy2);
}
rc = -ENOBUFS;
--
2.34.1
next reply other threads:[~2026-11-04 2:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 2:28 Wentao Liang [this message]
2026-11-04 2:32 ` [PATCH] ieee802154: drop the extra phy reference in del_iface netdev-bot+sinfo
2026-11-04 7:41 ` Krzysztof Kozlowski
2026-11-16 15:04 ` Miquel Raynal
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=20261104022809.1484165-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stefan@datenfreihafen.org \
/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