Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f718c2df authored by Emmanuel Grumbach's avatar Emmanuel Grumbach
Browse files

iwlwifi: mvm: fix theoretical NULL ptr dereference



mvmsta could have been NULL / ERR.

Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 50df8a30
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -312,6 +312,11 @@ static ssize_t iwl_dbgfs_reduced_txp_write(struct ieee80211_vif *vif,
	mutex_lock(&mvm->mutex);

	mvmsta = iwl_mvm_sta_from_staid_protected(mvm, mvmvif->ap_sta_id);
	if (IS_ERR_OR_NULL(mvmsta)) {
		mutex_unlock(&mvm->mutex);
		return -ENOTCONN;
	}

	mvmsta->bt_reduced_txpower_dbg = false;
	ret = iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id,
					  reduced_tx_power);