diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-10-17 03:28:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-08 15:53:57 -0500 |
commit | 48ef5c427ac2cfd12c150b38263d3ebb0d989647 (patch) | |
tree | 1a55cd4b28046dd4ed05f6892667695228823b65 /drivers | |
parent | 59034591029e9f3b691fe02ff60938556dba5683 (diff) |
ath9k_hw: min_t() casts u32 to int
The code here treats very large values of "limit" as less than
MAX_POWER_RATE because of the cast to int. We should do the compare
as u32 instead.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index f16d2033081f..e1dc084eac5b 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -2579,7 +2579,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) | |||
2579 | struct ath9k_channel *chan = ah->curchan; | 2579 | struct ath9k_channel *chan = ah->curchan; |
2580 | struct ieee80211_channel *channel = chan->chan; | 2580 | struct ieee80211_channel *channel = chan->chan; |
2581 | 2581 | ||
2582 | reg->power_limit = min_t(int, limit, MAX_RATE_POWER); | 2582 | reg->power_limit = min_t(u32, limit, MAX_RATE_POWER); |
2583 | if (test) | 2583 | if (test) |
2584 | channel->max_power = MAX_RATE_POWER / 2; | 2584 | channel->max_power = MAX_RATE_POWER / 2; |
2585 | 2585 | ||