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:43:11 +0000 (16:43 +0100)
commit39a974f8970268e7a02933e5cd6fab3e2dd8228e
treee55c363065224e0a256f32c0690f8f75368452f7
parentd8c47cad1263e77b2b68ad5f8067aa40b5407ee5
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