wifi: iwlwifi: pcie: propagate iwl_pcie_gen2_apm_init() error
authorJohannes Berg <johannes.berg@intel.com>
Tue, 26 Sep 2023 08:07:14 +0000 (11:07 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 23 Oct 2023 09:42:07 +0000 (11:42 +0200)
If iwl_pcie_gen2_apm_init() fails, we should propagate the
error code up, rather than ignoring it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.883768afe77b.Ic47cb8ce0a0abba3b4745cc2a721217c33360d6c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

index fa46dad5fd6802189f120150c87ea8027567cdff..085c4b49be87b15766e9878f4550734bb63ad0a2 100644 (file)
@@ -230,11 +230,14 @@ static int iwl_pcie_gen2_nic_init(struct iwl_trans *trans)
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        int queue_size = max_t(u32, IWL_CMD_QUEUE_SIZE,
                               trans->cfg->min_txq_size);
+       int ret;
 
        /* TODO: most of the logic can be removed in A0 - but not in Z0 */
        spin_lock_bh(&trans_pcie->irq_lock);
-       iwl_pcie_gen2_apm_init(trans);
+       ret = iwl_pcie_gen2_apm_init(trans);
        spin_unlock_bh(&trans_pcie->irq_lock);
+       if (ret)
+               return ret;
 
        iwl_op_mode_nic_config(trans->op_mode);