Netdev List
 help / color / mirror / Atom feed
* [PATCH] ieee802154: drop the extra phy reference in del_iface
@ 2026-11-04  2:28 Wentao Liang
  2026-11-04  2:32 ` netdev-bot+sinfo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wentao Liang @ 2026-11-04  2:28 UTC (permalink / raw)
  To: Alexander Aring, Stefan Schmidt, Miquel Raynal, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-wpan, netdev

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-16 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  2:28 [PATCH] ieee802154: drop the extra phy reference in del_iface Wentao Liang
2026-11-04  2:32 ` netdev-bot+sinfo
2026-11-04  7:41 ` Krzysztof Kozlowski
2026-11-16 15:04 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox