Эх сурвалжийг харах

iwlwifi: mvm: don't return uninitialized value in get_survey()

If ucode_loaded isn't true the function returns the 'ret' variable
without having assigned a value properly. Fix that.

Reported-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg 10 жил өмнө
parent
commit
10a7c028db

+ 1 - 0
drivers/net/wireless/iwlwifi/mvm/mac80211.c

@@ -3911,6 +3911,7 @@ static int iwl_mvm_mac_get_survey(struct ieee80211_hw *hw, int idx,
 			    mvm->radio_stats.on_time_scan;
 			    mvm->radio_stats.on_time_scan;
 	do_div(survey->time_scan, USEC_PER_MSEC);
 	do_div(survey->time_scan, USEC_PER_MSEC);
 
 
+	ret = 0;
  out:
  out:
 	mutex_unlock(&mvm->mutex);
 	mutex_unlock(&mvm->mutex);
 	return ret;
 	return ret;