Re: [PATCH] ieee802154: atusb: drop redundant device reference
From: Stefan Schmidt <stefan@datenfreihafen.org>
Date: 2026-03-22 22:37:26
Also in:
lkml
Hello, On 3/5/26 11:43, Johan Hovold wrote:
quoted hunk ↗ jump to hunk
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);
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> Jakub, Dave or Paolo can you folks please pick this up into net-next? I waited a moment but I have nothing else for wpan-next in the queue for now, so it would be silly to have a pull-request just for this. regards Stefan Schmidt