mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
ar9170: fix read & write outside array bounds
queue == __AR9170_NUM_TXQ would cause a bug on the next line. found by Smatch ( http://repo.or.cz/w/smatch.git ). Cc: stable@kernel.org Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
363ec5614f
commit
e9d126cdfa
1 changed files with 3 additions and 2 deletions
|
@ -1967,13 +1967,14 @@ static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
|
|||
int ret;
|
||||
|
||||
mutex_lock(&ar->mutex);
|
||||
if ((param) && !(queue > __AR9170_NUM_TXQ)) {
|
||||
if (queue < __AR9170_NUM_TXQ) {
|
||||
memcpy(&ar->edcf[ar9170_qos_hwmap[queue]],
|
||||
param, sizeof(*param));
|
||||
|
||||
ret = ar9170_set_qos(ar);
|
||||
} else
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
mutex_unlock(&ar->mutex);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue