cfg80211: Ingore country IEs with a zero set of number of channels
[safe/jmp/linux-2.6] / net / wireless / reg.c
index f0859ea..f3b77f7 100644 (file)
@@ -585,6 +585,9 @@ static int max_subband_chan(int orig_cur_chan,
                        break;
                }
 
+               if (triplet->chans.num_channels == 0)
+                       return 0;
+
                /* Monitonically increasing channel order */
                if (triplet->chans.first_channel <= end_subband_chan)
                        return 0;
@@ -737,6 +740,9 @@ static struct ieee80211_regdomain *country_ie_2_rd(
                        break;
                }
 
+               if (triplet->chans.num_channels == 0)
+                       return NULL;
+
                /* 2 GHz */
                if (triplet->chans.first_channel <= 14)
                        end_channel = triplet->chans.first_channel +