Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Johan Hovold and committed by
Johannes Berg
75e37581 c882b7a6

-3
-3
drivers/net/wireless/marvell/libertas/if_usb.c
··· 276 276 277 277 cardp->boot2_version = udev->descriptor.bcdDevice; 278 278 279 - usb_get_dev(udev); 280 279 usb_set_intfdata(intf, cardp); 281 280 282 281 r = lbs_get_firmware_async(priv, &udev->dev, cardp->model, ··· 286 287 return 0; 287 288 288 289 err_get_fw: 289 - usb_put_dev(udev); 290 290 lbs_remove_card(priv); 291 291 err_add_card: 292 292 if_usb_reset_device(cardp); ··· 319 321 kfree(cardp); 320 322 321 323 usb_set_intfdata(intf, NULL); 322 - usb_put_dev(interface_to_usbdev(intf)); 323 324 } 324 325 325 326 /**