Commit b7ad4aeb authored by Ilan Peer's avatar Ilan Peer Committed by Greg Kroah-Hartman

iwlwifi: Check BSS ctx active before call mac80211

commit e19ebcab upstream.

It is possible that the BSS context is not active (for example
when the current mode is set to GO), or that the vif->type is
different than station. In such a case we cannot
call mac80211 to report the average rssi for the interface
(the function assumes that the vif is valid and that the type
is station).
Reported-by: default avatarDaniel J Blueman <daniel@quora.org>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarIlan Peer <ilan.peer@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd9f6140
......@@ -617,6 +617,11 @@ static bool iwlagn_fill_txpower_mode(struct iwl_priv *priv,
struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
int ave_rssi;
if (!ctx->vif || (ctx->vif->type != NL80211_IFTYPE_STATION)) {
IWL_DEBUG_INFO(priv, "BSS ctx not active or not in sta mode\n");
return false;
}
ave_rssi = ieee80211_ave_rssi(ctx->vif);
if (!ave_rssi) {
/* no rssi data, no changes to reduce tx power */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment