From patchwork Sun Apr 10 19:09:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 696931 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3AJAsf4023175 for ; Sun, 10 Apr 2011 19:11:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755406Ab1DJTK3 (ORCPT ); Sun, 10 Apr 2011 15:10:29 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:63064 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755140Ab1DJTJ6 (ORCPT ); Sun, 10 Apr 2011 15:09:58 -0400 Received: by ewy4 with SMTP id 4so1529381ewy.19 for ; Sun, 10 Apr 2011 12:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding; bh=7JLn2nZF70/mpgSMrzcvZyFZ4LJ0owZ3zlxIA0AzpEI=; b=Q0PBEs+jDBHPvFZelyVai5nfVU3ASv3oAVCF+32ba4S+3tJJsJJbbCH+nXvlDTwZ50 gsc2TuRvp/jzyCtMwTi7cbN2eCnf3T2PhfKMT5MomqyvPsMlB9D780AqBL11PhGZfhYh KRnURMp63vvUjtGgzAZFsErmKKbj3vZ7wloy8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=efDxG5dFSCtAHKR01AIqnDyufDqJEkwX+UOfQU+D9GSWffhqQk/VHL8IoKsjagnogw rKrWGzTmGARTHnoklRxu8mx3AvwNZvQDAQxKJk9E4teLh7VA1BKf6CXBAj4jOgWd4kVd eKhy6ryjFO2+DOxA+KQsRa//vmaaSjJoY7agI= Received: by 10.14.15.97 with SMTP id e73mr1695997eee.159.1302462596490; Sun, 10 Apr 2011 12:09:56 -0700 (PDT) Received: from [192.168.1.7] (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id r48sm3211683eei.23.2011.04.10.12.09.55 (version=SSLv3 cipher=OTHER); Sun, 10 Apr 2011 12:09:55 -0700 (PDT) Message-ID: <4DA20083.8050208@gmail.com> Date: Sun, 10 Apr 2011 21:09:55 +0200 From: roel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: "Luis R. Rodriguez" , Jouni Malinen , Vasanthakumar Thiagarajan , Senthil Balasubramanian , linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net, Andrew Morton , LKML Subject: [PATCH 2/2] ath9k: index out of bounds Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 10 Apr 2011 19:11:28 +0000 (UTC) Check whether index is within bounds before testing the element Signed-off-by: Roel Kluin --- drivers/net/wireless/ath/ath9k/rc.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 4c0d36a..1809409 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c @@ -1092,8 +1092,7 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table, if (!(rate->flags & IEEE80211_TX_RC_MCS)) return rate->idx; - while (rate->idx > mcs_rix_off[i] && - i < ARRAY_SIZE(mcs_rix_off)) { + while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) { rix++; i++; }