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 --- 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