diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c')
| -rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 17 | 
1 files changed, 9 insertions, 8 deletions
| diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index 130760572262..63d65018d098 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c @@ -1,6 +1,6 @@  // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause  /* - * Copyright (C) 2012-2014, 2018-2020 Intel Corporation + * Copyright (C) 2012-2014, 2018-2021 Intel Corporation   * Copyright (C) 2013-2015 Intel Mobile Communications GmbH   * Copyright (C) 2016-2017 Intel Deutschland GmbH   */ @@ -1210,10 +1210,10 @@ static int _iwl_dbgfs_inject_beacon_ie(struct iwl_mvm *mvm, char *bin, int len)  			IWL_UCODE_TLV_API_NEW_BEACON_TEMPLATE))  		return -EINVAL; -	rcu_read_lock(); +	mutex_lock(&mvm->mutex);  	for (i = 0; i < NUM_MAC_INDEX_DRIVER; i++) { -		vif = iwl_mvm_rcu_dereference_vif_id(mvm, i, true); +		vif = iwl_mvm_rcu_dereference_vif_id(mvm, i, false);  		if (!vif)  			continue; @@ -1253,18 +1253,16 @@ static int _iwl_dbgfs_inject_beacon_ie(struct iwl_mvm *mvm, char *bin, int len)  				 &beacon_cmd.tim_size,  				 beacon->data, beacon->len); -	mutex_lock(&mvm->mutex);  	iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd,  					 sizeof(beacon_cmd));  	mutex_unlock(&mvm->mutex);  	dev_kfree_skb(beacon); -	rcu_read_unlock();  	return 0;  out_err: -	rcu_read_unlock(); +	mutex_unlock(&mvm->mutex);  	return -EINVAL;  } @@ -1786,10 +1784,13 @@ static ssize_t iwl_dbgfs_rfi_freq_table_write(struct iwl_mvm *mvm, char *buf,  		return -EINVAL;  	/* value zero triggers re-sending the default table to the device */ -	if (!op_id) +	if (!op_id) { +		mutex_lock(&mvm->mutex);  		ret = iwl_rfi_send_config_cmd(mvm, NULL); -	else +		mutex_unlock(&mvm->mutex); +	} else {  		ret = -EOPNOTSUPP; /* in the future a new table will be added */ +	}  	return ret ?: count;  } | 
