public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ieee802154: atusb: drop redundant device reference
@ 2026-03-05 10:43 Johan Hovold
  2026-03-09  8:55 ` Miquel Raynal
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Johan Hovold @ 2026-03-05 10:43 UTC (permalink / raw)
  To: Stefan Schmidt
  Cc: Alexander Aring, Miquel Raynal, Andrew Lunn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-wpan, netdev,
	linux-kernel, Johan Hovold

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


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

end of thread, other threads:[~2026-03-24  0:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 10:43 [PATCH] ieee802154: atusb: drop redundant device reference Johan Hovold
2026-03-09  8:55 ` Miquel Raynal
2026-03-22 22:27 ` Stefan Schmidt
2026-03-22 22:30   ` Stefan Schmidt
2026-03-23 21:33     ` Jakub Kicinski
2026-03-24  0:50 ` patchwork-bot+netdevbpf

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