aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-10-15 03:58:48 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-10-25 07:45:08 -0400
commit78ba82f777f3ab41f10afa3694c9c7633bf595d4 (patch)
treeb61b853495ce6628cecc642efc6daaef540ee14c
parentc8f423159e3e53d30e5b36a455797ee2072b09d0 (diff)
iwlwifi: mvm: take scan ref only on success
In some cases, scan reference was taken, but wasn't released even though scan command wasn't actually issued. Change the current code to simply take the reference only on success. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 0e9d28c23023..d6e0c1b5c20c 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -1190,8 +1190,6 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1190 if (ret) 1190 if (ret)
1191 return ret; 1191 return ret;
1192 1192
1193 iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN);
1194
1195 /* we should have failed registration if scan_cmd was NULL */ 1193 /* we should have failed registration if scan_cmd was NULL */
1196 if (WARN_ON(!mvm->scan_cmd)) 1194 if (WARN_ON(!mvm->scan_cmd))
1197 return -ENOMEM; 1195 return -ENOMEM;
@@ -1232,21 +1230,20 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
1232 return ret; 1230 return ret;
1233 1231
1234 ret = iwl_mvm_send_cmd(mvm, &hcmd); 1232 ret = iwl_mvm_send_cmd(mvm, &hcmd);
1235 if (!ret) { 1233 if (ret) {
1236 IWL_DEBUG_SCAN(mvm, "Scan request was sent successfully\n");
1237 mvm->scan_status |= IWL_MVM_SCAN_REGULAR;
1238 } else {
1239 /* If the scan failed, it usually means that the FW was unable 1234 /* If the scan failed, it usually means that the FW was unable
1240 * to allocate the time events. Warn on it, but maybe we 1235 * to allocate the time events. Warn on it, but maybe we
1241 * should try to send the command again with different params. 1236 * should try to send the command again with different params.
1242 */ 1237 */
1243 IWL_ERR(mvm, "Scan failed! ret %d\n", ret); 1238 IWL_ERR(mvm, "Scan failed! ret %d\n", ret);
1239 return ret;
1244 } 1240 }
1245 1241
1246 if (ret) 1242 IWL_DEBUG_SCAN(mvm, "Scan request was sent successfully\n");
1247 iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); 1243 mvm->scan_status |= IWL_MVM_SCAN_REGULAR;
1244 iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN);
1248 1245
1249 return ret; 1246 return 0;
1250} 1247}
1251 1248
1252int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, 1249int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,