Thread (5 messages) 5 messages, 4 authors, 2026-03-24
STALE123d

[PATCH] ieee802154: atusb: drop redundant device reference

From: Johan Hovold <johan@kernel.org>
Date: 2026-03-05 10:43:39
Also in: lkml
Subsystem: atusb ieee 802.15.4 radio driver, ieee 802.15.4 subsystem, networking drivers, the rest · Maintainers: Stefan Schmidt, Alexander Aring, Miquel Raynal, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop the redundant device reference to reduce cargo culting, make it
easier to spot drivers where an extra reference is needed, and reduce
the risk of memory leaks when drivers fail to release it.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/ieee802154/atusb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 95a4a3cdc8a4..5f7fc4ee7a07 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -961,7 +961,7 @@ static int atusb_probe(struct usb_interface *interface,
 
 	atusb = hw->priv;
 	atusb->hw = hw;
-	atusb->usb_dev = usb_get_dev(usb_dev);
+	atusb->usb_dev = usb_dev;
 	usb_set_intfdata(interface, atusb);
 
 	atusb->shutdown = 0;
@@ -1055,7 +1055,6 @@ static int atusb_probe(struct usb_interface *interface,
 	atusb_free_urbs(atusb);
 	usb_kill_urb(atusb->tx_urb);
 	usb_free_urb(atusb->tx_urb);
-	usb_put_dev(usb_dev);
 	ieee802154_free_hw(hw);
 	return ret;
 }
@@ -1076,8 +1075,6 @@ static void atusb_disconnect(struct usb_interface *interface)
 
 	ieee802154_unregister_hw(atusb->hw);
 
-	usb_put_dev(atusb->usb_dev);
-
 	ieee802154_free_hw(atusb->hw);
 
 	usb_set_intfdata(interface, NULL);
-- 
2.52.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help