diff mbox

[08/11] rtlwifi: rtl8723: Add error handling to no existing firmware

Message ID 20171229083112.31540-9-pkshih@realtek.com (mailing list archive)
State Accepted
Commit 981a2b6e055bce9a9f780fb074ffdf9a9bab0d47
Delegated to: Kalle Valo
Headers show

Commit Message

Ping-Ke Shih Dec. 29, 2017, 8:31 a.m. UTC
From: Ping-Ke Shih <pkshih@realtek.com>

Without firmware, driver wastes time to download and wait for MCU bootup,
and then kernel core dump finally. If request_firmware fails, the value
max_fw_size=0 is set, so we check the value before downloading firmware.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
index efa7e1262461..0d1ebc861720 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
@@ -196,7 +196,7 @@  int rtl8723_download_fw(struct ieee80211_hw *hw,
 	enum version_8723e version = rtlhal->version;
 	int max_page;
 
-	if (!rtlhal->pfirmware)
+	if (rtlpriv->max_fw_size == 0 || !rtlhal->pfirmware)
 		return 1;
 
 	pfwheader = (struct rtlwifi_firmware_header *)rtlhal->pfirmware;