aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-03-03 16:55:21 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-06 15:54:32 -0500
commitbd05f28e1a15ae62994fe309a524695fe26dd834 (patch)
treeef5cddeab99411715e1a689d5936dc9eacc74bfb /net/wireless/reg.c
parent623d563e52d4d4041612e24b33a5610a900dd778 (diff)
cfg80211: test before subtraction on unsigned
freq_diff is unsigned, so test before subtraction Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 85c9034c59b2..bd0a16c3de5e 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -380,7 +380,8 @@ static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
380 380
381 freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz; 381 freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
382 382
383 if (freq_diff <= 0 || freq_range->max_bandwidth_khz > freq_diff) 383 if (freq_range->end_freq_khz <= freq_range->start_freq_khz ||
384 freq_range->max_bandwidth_khz > freq_diff)
384 return false; 385 return false;
385 386
386 return true; 387 return true;