Commit bd05f28e authored by Roel Kluin's avatar Roel Kluin Committed by John W. Linville

cfg80211: test before subtraction on unsigned

freq_diff is unsigned, so test before subtraction
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 623d563e
...@@ -380,7 +380,8 @@ static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule) ...@@ -380,7 +380,8 @@ static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz; freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
if (freq_diff <= 0 || freq_range->max_bandwidth_khz > freq_diff) if (freq_range->end_freq_khz <= freq_range->start_freq_khz ||
freq_range->max_bandwidth_khz > freq_diff)
return false; return false;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment