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>
This commit is contained in:
Souptick Joarder
2017-07-05 19:55:06 +05:30
committed by Kalle Valo
parent 4de95fc5fa
commit f2764f61fa
9 changed files with 24 additions and 0 deletions

View File

@@ -195,6 +195,8 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
rtl_fw_cb);
if (err) {
pr_err("Failed to request firmware!\n");
vfree(rtlpriv->rtlhal.pfirmware);
rtlpriv->rtlhal.pfirmware = NULL;
return 1;
}
}