cfg80211: mark negative frequencies as invalid
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 12 Nov 2008 22:21:55 +0000 (14:21 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 25 Nov 2008 21:41:21 +0000 (16:41 -0500)
Regulatory rules with negative frequencies are now
marked as invalid in is_valid_reg_rule().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/reg.c

index 4c7e39d466c430e34d4f2ec5bad649f1f6111ca7..7a2ce270f4d3e33e6db853b30a72eefa3b12deeb 100644 (file)
@@ -330,7 +330,7 @@ static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
        const struct ieee80211_freq_range *freq_range = &rule->freq_range;
        u32 freq_diff;
 
-       if (freq_range->start_freq_khz == 0 || freq_range->end_freq_khz == 0)
+       if (freq_range->start_freq_khz <= 0 || freq_range->end_freq_khz <= 0)
                return false;
 
        if (freq_range->start_freq_khz > freq_range->end_freq_khz)