mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
wifi: libertas: drop redundant device reference
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> Link: https://patch.msgid.link/20260306085144.12064-8-johan@kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
c882b7a603
commit
75e3758163
|
|
@ -276,7 +276,6 @@ static int if_usb_probe(struct usb_interface *intf,
|
|||
|
||||
cardp->boot2_version = udev->descriptor.bcdDevice;
|
||||
|
||||
usb_get_dev(udev);
|
||||
usb_set_intfdata(intf, cardp);
|
||||
|
||||
r = lbs_get_firmware_async(priv, &udev->dev, cardp->model,
|
||||
|
|
@ -287,7 +286,6 @@ static int if_usb_probe(struct usb_interface *intf,
|
|||
return 0;
|
||||
|
||||
err_get_fw:
|
||||
usb_put_dev(udev);
|
||||
lbs_remove_card(priv);
|
||||
err_add_card:
|
||||
if_usb_reset_device(cardp);
|
||||
|
|
@ -321,7 +319,6 @@ static void if_usb_disconnect(struct usb_interface *intf)
|
|||
kfree(cardp);
|
||||
|
||||
usb_set_intfdata(intf, NULL);
|
||||
usb_put_dev(interface_to_usbdev(intf));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user