aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2014-08-12 17:26:17 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-09-08 12:47:22 -0400
commit2cddddc56a1179aa71b460ad616176c237d4a243 (patch)
tree561e553def9c08cb629ecd051336e71d5c01fe05 /drivers/net/wireless/iwlwifi
parent498abba6a0b2bc7ed0b57772d664a549dcabc4d7 (diff)
iwlwifi: mvm: fix an overflow in iwl_mvm_get_signal_strength
The idea here is to translate a value of 0 received from the firmware to the lowest rssi figure. As rx_status->chain_signal is a signed byte the lowest possible value is -128 and not -256. -256 was causing 0 to get stored in the signed byte. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/rx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rx.c b/drivers/net/wireless/iwlwifi/mvm/rx.c
index 4b98987fc413..bf5cd8c8b0f7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rx.c
@@ -149,13 +149,13 @@ static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm,
149 le32_to_cpu(phy_info->non_cfg_phy[IWL_RX_INFO_ENERGY_ANT_ABC_IDX]); 149 le32_to_cpu(phy_info->non_cfg_phy[IWL_RX_INFO_ENERGY_ANT_ABC_IDX]);
150 energy_a = (val & IWL_RX_INFO_ENERGY_ANT_A_MSK) >> 150 energy_a = (val & IWL_RX_INFO_ENERGY_ANT_A_MSK) >>
151 IWL_RX_INFO_ENERGY_ANT_A_POS; 151 IWL_RX_INFO_ENERGY_ANT_A_POS;
152 energy_a = energy_a ? -energy_a : -256; 152 energy_a = energy_a ? -energy_a : S8_MIN;
153 energy_b = (val & IWL_RX_INFO_ENERGY_ANT_B_MSK) >> 153 energy_b = (val & IWL_RX_INFO_ENERGY_ANT_B_MSK) >>
154 IWL_RX_INFO_ENERGY_ANT_B_POS; 154 IWL_RX_INFO_ENERGY_ANT_B_POS;
155 energy_b = energy_b ? -energy_b : -256; 155 energy_b = energy_b ? -energy_b : S8_MIN;
156 energy_c = (val & IWL_RX_INFO_ENERGY_ANT_C_MSK) >> 156 energy_c = (val & IWL_RX_INFO_ENERGY_ANT_C_MSK) >>
157 IWL_RX_INFO_ENERGY_ANT_C_POS; 157 IWL_RX_INFO_ENERGY_ANT_C_POS;
158 energy_c = energy_c ? -energy_c : -256; 158 energy_c = energy_c ? -energy_c : S8_MIN;
159 max_energy = max(energy_a, energy_b); 159 max_energy = max(energy_a, energy_b);
160 max_energy = max(max_energy, energy_c); 160 max_energy = max(max_energy, energy_c);
161 161