Skip to content

Commit

Permalink
cfg80211: a reg rule is invalid if freq diff is 0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Nov 10, 2008
1 parent fc6971d commit d71aaf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d71aaf6

Please sign in to comment.