iwlwifi: mvm: fix bug in scan ssid
authorDavid Spinadel <david.spinadel@intel.com>
Thu, 4 Jul 2013 12:17:48 +0000 (15:17 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 Jul 2013 10:55:08 +0000 (13:55 +0300)
Increment index in each iteration. Without this increment we are
overriding the added SSIDs and we will send only the last SSId
and (n_ssids - 1) broadcast probes.

Cc: <stable@vger.kernel.org> [3.9+]
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/mvm/scan.c

index 2157b0f8ced5cc7c314a246d758a869128e57c59..8023deec20cb8ac28893324122e00f3b78b0e86a 100644 (file)
@@ -137,8 +137,8 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_scan_cmd *cmd,
 {
        int fw_idx, req_idx;
 
-       fw_idx = 0;
-       for (req_idx = req->n_ssids - 1; req_idx > 0; req_idx--) {
+       for (req_idx = req->n_ssids - 1, fw_idx = 0; req_idx > 0;
+            req_idx--, fw_idx++) {
                cmd->direct_scan[fw_idx].id = WLAN_EID_SSID;
                cmd->direct_scan[fw_idx].len = req->ssids[req_idx].ssid_len;
                memcpy(cmd->direct_scan[fw_idx].ssid,