From patchwork Sun Apr 10 19:09:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 696921 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 p3AJAsf2023175 for ; Sun, 10 Apr 2011 19:10:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753987Ab1DJTJy (ORCPT ); Sun, 10 Apr 2011 15:09:54 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:51285 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753603Ab1DJTJx (ORCPT ); Sun, 10 Apr 2011 15:09:53 -0400 Received: by eyx24 with SMTP id 24so1530922eyx.19 for ; Sun, 10 Apr 2011 12:09:52 -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=zpgiZE9j93bRg5318ZxTcjPTOorSUNeLjHzc5XWQf8k=; b=QKuLhxRyUmJfUWUhHsc0q+XK/H0rjWyY4qqYrDhp/U9MIpwE0YcelfoONUo/1szTi+ VjzCGuwPq0vD2sE6bo/3KSxNpEMmQL+I3oIoB0l/tU36qfhMq5MEj8uelIAUZdEiWdV6 36PiUKtE7BwDGUsSWLhKVOoN2fmffbBG/B/cE= 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=M7fUHGbhgcWvfEAvlQ0/MzN3IJNu0PN62K5LCbD4E7qqb6eAgXJPGJzUynP38QpjmM 5VWR7uMPDKFbXpvVvPVYH4artynqgvjB7dDg4IYO5cfxJWkARHCR6zwGeR+BqlHVA9r5 Z91Cmlc2NzLMnvlpFg+UiXm6KsT1/S2OXAS48= Received: by 10.213.20.78 with SMTP id e14mr1818184ebb.74.1302462592135; Sun, 10 Apr 2011 12:09:52 -0700 (PDT) Received: from [192.168.1.7] (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id m55sm1133957eei.15.2011.04.10.12.09.50 (version=SSLv3 cipher=OTHER); Sun, 10 Apr 2011 12:09:51 -0700 (PDT) Message-ID: <4DA2007E.4000307@gmail.com> Date: Sun, 10 Apr 2011 21:09:50 +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 1/2] ath9k_hw: 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:27 +0000 (UTC) Check whether index is within bounds before testing the element Both spurChans arrays in modalHeader5G and modalHeader2G have 5 elements, AR_EEPROM_MODAL_SPURS is defined 5. So unless a break occurs, in the last iteration (i=5) we tried to access spurChansPtr[5] before testing whether i was within bounds. Fix this. Signed-off-by: Roel Kluin --- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 2 +- 1 files changed, 1 insertions(+), 1 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/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index eb250d6..93398de 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c @@ -401,7 +401,7 @@ static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah, ar9003_hw_spur_ofdm_clear(ah); - for (i = 0; spurChansPtr[i] && i < 5; i++) { + for (i = 0; i < AR_EEPROM_MODAL_SPURS && spurChansPtr[i]; i++) { freq_offset = FBIN2FREQ(spurChansPtr[i], mode) - synth_freq; if (abs(freq_offset) < range) { ar9003_hw_spur_ofdm_work(ah, chan, freq_offset);