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_tf: 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-9-johan@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Johan Hovold and committed by
Johannes Berg
b1af0de3 75e37581

-2
-2
drivers/net/wireless/marvell/libertas_tf/if_usb.c
··· 223 223 if (!priv) 224 224 goto dealloc; 225 225 226 - usb_get_dev(udev); 227 226 usb_set_intfdata(intf, cardp); 228 227 229 228 return 0; ··· 257 258 kfree(cardp); 258 259 259 260 usb_set_intfdata(intf, NULL); 260 - usb_put_dev(interface_to_usbdev(intf)); 261 261 262 262 lbtf_deb_leave(LBTF_DEB_MAIN); 263 263 }