From: Roel Kluin Date: Tue, 3 Mar 2009 21:55:21 +0000 (+0100) Subject: cfg80211: test before subtraction on unsigned X-Git-Tag: MMI-PSA29.97-13-9~29256^2~47 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bd05f28e1a15ae62994fe309a524695fe26dd834;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git cfg80211: test before subtraction on unsigned freq_diff is unsigned, so test before subtraction Signed-off-by: Roel Kluin Signed-off-by: John W. Linville --- 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) 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;