rtlwifi: prevent memory leak in rtl_usb_probe
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Wed, 25 Sep 2019 01:20:21 +0000 (20:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:34:49 +0000 (16:34 +0100)
commit3717a450f83945c481059a6921440e5e6fe3c856
treeaf0cc01234a60df75bec1e3c5c2b21a656bcf442
parentdd97f971bee39389f60a21ded134c20b06f6e4d8
rtlwifi: prevent memory leak in rtl_usb_probe

[ Upstream commit 3f93616951138a598d930dcaec40f2bfd9ce43bb ]

In rtl_usb_probe if allocation for usb_data fails the allocated hw
should be released. In addition the allocated rtlpriv->usb_data should
be released on error handling path.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtlwifi/usb.c