Skip to content

Commit

Permalink
wifi: libertas: Fix possible refcount leak in if_usb_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit 6fd57e1 ]

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: ce84bb6 ("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>
  • Loading branch information
HBh25Y authored and gregkh committed Aug 17, 2022
1 parent 4a40af2 commit d736559
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/wireless/marvell/libertas/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d736559

Please sign in to comment.