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 <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Luis R. Rodriguez 2008-10-30 13:33:52 -07:00 committed by John W. Linville
parent fc6971d491
commit d71aaf6053

View file

@ -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;