Skip to content

Commit

Permalink
ar9170: fix read & write outside array bounds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and John W. Linville committed Aug 10, 2009
1 parent 363ec56 commit e9d126c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/ath/ar9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e9d126c

Please sign in to comment.