Skip to contentSkip to conversation

libertas: Fix possible refcount leak in if_usb_probe()

PATCH In review Hangyu Hua 2 participants 2 messages Jun 20, 2022 – Jul 27, 2022

Subsystems (3)
lore
Share & tools
lore

Hangyu Hua

author
#0 lore raw

PATCH 1/1 libertas: Fix possible refcount leak in if_usb_probe()

usb_get_dev will be called before lbs_get_firmware_async which means that usb_put_dev need to be called when lbs_get_firmware_async fails.

Fixes ce84bb69f50e ("libertas USB: convert to asynchronous firmware loading")
---
 drivers/net/wireless/marvell/libertas/if_usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/marvell/libertas/if_usb.c +1 -0
index 5d6dc1dd050d..32fdc4150b60 100644
@@ -287,6 +287,7 @@ 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);
Signature · 1 line
2.25.1
#1 lore raw

Re: wifi: libertas: Fix possible refcount leak in if_usb_probe()

Quoted 5 lines · Hangyu Hua

usb_get_dev will be called before lbs_get_firmware_async which means that usb_put_dev need to be called when lbs_get_firmware_async fails.

Fixes ce84bb69f50e ("libertas USB: convert to asynchronous firmware loading")

Patch applied to wireless-next.git, thanks.

2cfb08d6c5c9 wifi: libertas: Fix possible refcount leak in if_usb_probe()

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches