From: Luis R. Rodriguez Date: Thu, 30 Oct 2008 20:33:52 +0000 (-0700) Subject: cfg80211: a reg rule is invalid if freq diff is 0 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d71aaf6053e380996e40c9ecfe39a8dced52694c;p=openwrt%2Fstaging%2Fblogic.git cfg80211: a reg rule is invalid if freq diff is 0 A regulatory rule is invalid when the frequency difference between the end of the frequency range and the start is 0. Signed-off-by: Luis R. Rodriguez Signed-off-by: John W. Linville --- diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 8e5d23975a0d..34983a825ac1 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -321,7 +321,7 @@ static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule) freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz; - if (freq_range->max_bandwidth_khz > freq_diff) + if (freq_diff <= 0 || freq_range->max_bandwidth_khz > freq_diff) return false; return true;