diff options
author | Hangyu Hua <hbh25y@gmail.com> | 2022-06-20 17:23:50 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-08-25 11:15:12 +0200 |
commit | 4c8e2f9ce1428e44cb103035eeced7aeb6b80980 (patch) | |
tree | 5ef7836e9109284e91881f8cdf8c83455723082e /drivers/net/wireless | |
parent | c9fde3a44da566d8929070ab6bda4f0dfa9955d0 (diff) | |
download | linux-stable-4c8e2f9ce1428e44cb103035eeced7aeb6b80980.tar.gz linux-stable-4c8e2f9ce1428e44cb103035eeced7aeb6b80980.tar.bz2 linux-stable-4c8e2f9ce1428e44cb103035eeced7aeb6b80980.zip |
wifi: libertas: Fix possible refcount leak in if_usb_probe()
[ Upstream commit 6fd57e1d120bf13d4dc6c200a7cf914e6347a316 ]
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>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220620092350.39960-1-hbh25y@gmail.com
Link: https://lore.kernel.org/r/20220622113402.16969-1-colin.i.king@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/marvell/libertas/if_usb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c index f29a154d995c..d75763410cdc 100644 --- a/drivers/net/wireless/marvell/libertas/if_usb.c +++ b/drivers/net/wireless/marvell/libertas/if_usb.c @@ -283,6 +283,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); |