OSDN Git Service

Accumulative patch from commit 9e4d304ed7e2516b92081a5fba7288715ebb
[android-x86/external-wpa_supplicant_8.git] / wpa_supplicant / bgscan_learn.c
index adf82d8..07d31e4 100644 (file)
@@ -242,8 +242,11 @@ static int * bgscan_learn_get_probe_freq(struct bgscan_learn_data *data,
 
        idx = data->probe_idx + 1;
        while (idx != data->probe_idx) {
-               if (data->supp_freqs[idx] == 0)
+               if (data->supp_freqs[idx] == 0) {
+                       if (data->probe_idx == 0)
+                               break;
                        idx = 0;
+               }
                if (!in_array(freqs, data->supp_freqs[idx])) {
                        wpa_printf(MSG_DEBUG, "bgscan learn: Probe new freq "
                                   "%u", data->supp_freqs[idx]);