Skip to contentSkip to conversation

iwlwifi: Fix missing error code in iwl_pci_probe()

PATCH In review Jiapeng Chong 3 participants 3 messages Nov 2, 2021 – Nov 22, 2021

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

PATCH v2 1/1 iwlwifi: Fix missing error code in iwl_pci_probe()

From: chongjiapeng <[email protected]>

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1376 iwl_pci_probe() warn:
missing error code 'ret'.

Fixes 1f171f4f1437 ("iwlwifi: Add support for getting rf id with blank otp")

---
Changes in v2:
-For the following advice:
https://lore.kernel.org/lkml/[email protected]/

 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +3 -1
index c574f041f096..33250d24c2b9 100644
@@ -1442,8 +1442,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	 */
 	if (iwl_trans->trans_cfg->rf_id &&
 	    iwl_trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_9000 &&
-	    !CSR_HW_RFID_TYPE(iwl_trans->hw_rf_id) && get_crf_id(iwl_trans))
+	    !CSR_HW_RFID_TYPE(iwl_trans->hw_rf_id) && get_crf_id(iwl_trans)) {
+		ret = -EINVAL;
 		goto out_free_trans;
+	}
 
 	dev_info = iwl_pci_find_dev_info(pdev->device, pdev->subsystem_device,
 					 CSR_HW_REV_TYPE(iwl_trans->hw_rev),
Signature · 1 line
2.19.1.6.gb485710b
Acked-by on v2 1/1
#1 lore raw
Quoted 27 lines · Jiapeng Chong

From: chongjiapeng <[email protected]>

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1376 iwl_pci_probe() warn:
missing error code 'ret'.

Fixes 1f171f4f1437 ("iwlwifi: Add support for getting rf id with blank otp")

---
Changes in v2:
-For the following advice:
https://lore.kernel.org/lkml/[email protected]/

 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +0 -0
index c574f041f096..33250d24c2b9 100644
@@ -1442,8 +1442,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	 */

drivers/net/wireless/intel/iwlwifi/pcie/drv.c static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · line 1451

Quoted 10 lines
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +3 -1
 	if (iwl_trans->trans_cfg->rf_id &&
 	    iwl_trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_9000 &&
-	    !CSR_HW_RFID_TYPE(iwl_trans->hw_rf_id) && get_crf_id(iwl_trans))
+	    !CSR_HW_RFID_TYPE(iwl_trans->hw_rf_id) && get_crf_id(iwl_trans)) {
+		ret = -EINVAL;
 		goto out_free_trans;
+	}
 
 	dev_info = iwl_pci_find_dev_info(pdev->device, pdev->subsystem_device,
 					 CSR_HW_REV_TYPE(iwl_trans->hw_rev),

Thanks!

Kalle, can you pick this up for wireless-drivers.git? I have assigned it to you in patchwork.

--
Cheers,
Luca.

#2 lore raw
In reply to Jiapeng Chong
Quoted 7 lines · Jiapeng Chong

From: chongjiapeng <[email protected]>

The error code is missing in this code scenario, add the error code '-EINVAL' to the return value 'ret'.

Eliminate the follow smatch warning:

Quoted 7 lines

drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1376 iwl_pci_probe() warn:
missing error code 'ret'.

Fixes 1f171f4f1437 ("iwlwifi: Add support for getting rf id with blank otp")

Patch applied to wireless-drivers.git, thanks.

1b54403c9cc4 iwlwifi: Fix missing error code in iwl_pci_probe()

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/1635838727-128735-1-git-send-email-jiapeng.chong@linux.alibaba.com/

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