mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
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>
This commit is contained in:
parent
623d563e52
commit
bd05f28e1a
@ -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;
|
||||
|
||||
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 true;
|
||||
|
Loading…
Reference in New Issue
Block a user