diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 12 | ||||
-rw-r--r-- | net/wireless/util.c | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index b96fc0c3f1c4..125226476089 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -273,10 +273,16 @@ int wiphy_register(struct wiphy *wiphy) | |||
273 | 273 | ||
274 | sband->band = band; | 274 | sband->band = band; |
275 | 275 | ||
276 | if (!sband->n_channels || !sband->n_bitrates) { | 276 | if (WARN_ON(!sband->n_channels || !sband->n_bitrates)) |
277 | WARN_ON(1); | 277 | return -EINVAL; |
278 | |||
279 | /* | ||
280 | * Since we use a u32 for rate bitmaps in | ||
281 | * ieee80211_get_response_rate, we cannot | ||
282 | * have more than 32 legacy rates. | ||
283 | */ | ||
284 | if (WARN_ON(sband->n_bitrates > 32)) | ||
278 | return -EINVAL; | 285 | return -EINVAL; |
279 | } | ||
280 | 286 | ||
281 | for (i = 0; i < sband->n_channels; i++) { | 287 | for (i = 0; i < sband->n_channels; i++) { |
282 | sband->channels[i].orig_flags = | 288 | sband->channels[i].orig_flags = |
diff --git a/net/wireless/util.c b/net/wireless/util.c index e76cc28b0345..487cdd9bcffc 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | struct ieee80211_rate * | 10 | struct ieee80211_rate * |
11 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, | 11 | ieee80211_get_response_rate(struct ieee80211_supported_band *sband, |
12 | u64 basic_rates, int bitrate) | 12 | u32 basic_rates, int bitrate) |
13 | { | 13 | { |
14 | struct ieee80211_rate *result = &sband->bitrates[0]; | 14 | struct ieee80211_rate *result = &sband->bitrates[0]; |
15 | int i; | 15 | int i; |