linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libertas: Fix possible refcount leak in if_usb_probe()
@ 2022-06-20  9:23 Hangyu Hua
  2022-07-27 12:48 ` wifi: " Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Hangyu Hua @ 2022-06-20  9:23 UTC (permalink / raw)
  To: kvalo, davem, edumazet, kuba, pabeni, wanghai38, dsd, linville, dcbw
  Cc: libertas-dev, linux-wireless, netdev, linux-kernel, 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")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
 drivers/net/wireless/marvell/libertas/if_usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c
index 5d6dc1dd050d..32fdc4150b60 100644
--- a/drivers/net/wireless/marvell/libertas/if_usb.c
+++ b/drivers/net/wireless/marvell/libertas/if_usb.c
@@ -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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: wifi: libertas: Fix possible refcount leak in if_usb_probe()
  2022-06-20  9:23 [PATCH] libertas: Fix possible refcount leak in if_usb_probe() Hangyu Hua
@ 2022-07-27 12:48 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2022-07-27 12:48 UTC (permalink / raw)
  To: Hangyu Hua
  Cc: davem, edumazet, kuba, pabeni, wanghai38, dsd, linville, dcbw,
	libertas-dev, linux-wireless, netdev, linux-kernel, Hangyu Hua

Hangyu Hua <hbh25y@gmail.com> wrote:

> 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")
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>

Patch applied to wireless-next.git, thanks.

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

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220620092350.39960-1-hbh25y@gmail.com/

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-27 12:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20  9:23 [PATCH] libertas: Fix possible refcount leak in if_usb_probe() Hangyu Hua
2022-07-27 12:48 ` wifi: " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).