diff options
author | Souptick Joarder <jrdr.linux@gmail.com> | 2017-07-05 17:25:06 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-07-28 18:42:25 +0300 |
commit | f2764f61fa10593204b0c5e4e9a68dba02112e50 (patch) | |
tree | 42c3ef23214e3fa4f8134ca0ba0f6967e628c17a /drivers/net/wireless/realtek/rtlwifi/rtl8192cu | |
parent | 4de95fc5fa1192b6c4d89545b6a788cc6de97429 (diff) | |
download | linux-f2764f61fa10593204b0c5e4e9a68dba02112e50.tar.xz |
rtlwifi: Fix memory leak when firmware request fails
This patch will fix memory leak when firmware request fails
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/rtl8192cu')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c index 62d9214b6fdc..dfbbd35bb966 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c @@ -85,6 +85,10 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) err = request_firmware_nowait(THIS_MODULE, 1, fw_name, rtlpriv->io.dev, GFP_KERNEL, hw, rtl_fw_cb); + if (err) { + vfree(rtlpriv->rtlhal.pfirmware); + rtlpriv->rtlhal.pfirmware = NULL; + } return err; } |