]> git.baikalelectronics.ru Git - kernel.git/commit
ath9k_htc: memory corruption calling set_bit()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 14 May 2015 08:34:48 +0000 (11:34 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 26 May 2015 10:54:23 +0000 (13:54 +0300)
commit937dd0fb8035768b33b64046775380cd2bc5d15b
tree167648df470def9ae6b4569a3db6cfe851387349
parent7eea12ed0d902e25182f264796799eda9fb3969e
ath9k_htc: memory corruption calling set_bit()

In 7fb800d917e7 ('ath9k_htc: Use atomic operations for op_flags') we
changed things like this:

- if (priv->op_flags & OP_TSF_RESET) {
+ if (test_bit(OP_TSF_RESET, &priv->op_flags)) {

The problem is that test_bit() takes a bit number and not a mask.  It
means that when we do:

set_bit(OP_TSF_RESET, &priv->op_flags);

Then it sets the (1 << 6) bit instead of the 6 bit so we are setting a
bit which is past the end of the unsigned long.

Fixes: 7fb800d917e7 ('ath9k_htc: Use atomic operations for op_flags')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/htc.h