Skip to contentSkip to conversation

wifi: rtw89: uninitialized variable on error in rtw89_early_fw_feature_recognize()

PATCH In review Dan Carpenter 3 participants 3 messages Sep 15, 2022 – Sep 19, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rtw89: uninitialized variable on error in rtw89_early_fw_feature_recognize()

If request_partial_firmware_into_buf() fails then "firmware" is not initialized and the release_firmware(firmware) will crash.

Fixes deebea35d699 ("wifi: rtw89: early recognize FW feature to decide if chanctx")
---
 drivers/net/wireless/realtek/rtw89/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/fw.c +1 -1
index 8e4d0e18fa71..2be70b907762 100644
@@ -268,7 +268,7 @@ void rtw89_early_fw_feature_recognize(struct device *device,
 						device, &buf, sizeof(buf), 0);
 	if (ret) {
 		dev_err(device, "failed to early request firmware: %d\n", ret);
-		goto out;
+		return;
 	}
 
 	ver_code = buf.mfw_hdr.sig != RTW89_MFW_SIG ?
Signature · 1 line
2.35.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Dan Carpenter <[email protected]>
Sent: Thursday, September 15, 2022 10:14 PM
To: Ping-Ke Shih <[email protected]>; Kevin Yang <[email protected]>
Cc: Kalle Valo <[email protected]>; Kevin Yang <[email protected]>; [email protected]; [email protected]
Subject: [PATCH] wifi: rtw89: uninitialized variable on error in rtw89_early_fw_feature_recognize()

Quoted 5 lines

If request_partial_firmware_into_buf() fails then "firmware" is not initialized and the release_firmware(firmware) will crash.

Fixes deebea35d699 ("wifi: rtw89: early recognize FW feature to decide if chanctx")

Thank you.

Quoted 22 lines
---
 drivers/net/wireless/realtek/rtw89/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/fw.c +1 -2
index 8e4d0e18fa71..2be70b907762 100644
@@ -268,7 +268,7 @@ void rtw89_early_fw_feature_recognize(struct device *device,
 						device, &buf, sizeof(buf), 0);
 	if (ret) {
 		dev_err(device, "failed to early request firmware: %d\n", ret);
-		goto out;
+		return;
 	}
 
 	ver_code = buf.mfw_hdr.sig != RTW89_MFW_SIG ?
--

2.35.1

------Please consider the environment before printing this e-mail.

#2 lore raw
In reply to Dan Carpenter
Quoted 6 lines · Dan Carpenter

If request_partial_firmware_into_buf() fails then "firmware" is not initialized and the release_firmware(firmware) will crash.

Fixes deebea35d699 ("wifi: rtw89: early recognize FW feature to decide if chanctx")

Patch applied to wireless-next.git, thanks.

4c3140f4cea6 wifi: rtw89: uninitialized variable on error in rtw89_early_fw_feature_recognize()

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/YyMzDtX/3fUBnonC@kili/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches