From: Joe Perches <joe@perches.com>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>,
Jouni Malinen <jmalinen@atheros.com>,
Vasanthakumar Thiagarajan <vasanth@atheros.com>,
Senthil Balasubramanian <senthilkumar@atheros.com>
Cc: Peter Stuge <peter@stuge.se>, Felix Fietkau <nbd@openwrt.org>,
"John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] ath: Fix ath_dbg access beyond array bound
Date: Thu, 2 Dec 2010 19:12:38 -0800 [thread overview]
Message-ID: <f27b95daeb152de787dea20e4eefd21e65a7108e.1291333544.git.joe@perches.com> (raw)
In-Reply-To: <20101202190239.GE7399@tux>
In-Reply-To: <cover.1291333543.git.joe@perches.com>
ar9300RateSize is not necessarily a power of 4.
Change ar9003_hw_set_target_power_eeprom
to print the targetPowerValT2 array one per line.
ath9k_hw_ar9300_set_txpower repeated the output 4 times per line,
change it to print the targetPowerValT2 value one per line.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 27 +----------------------
1 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 7b13a2e..34d1d7a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4086,22 +4086,9 @@ static void ar9003_hw_set_target_power_eeprom(struct ath_hw *ah, u16 freq,
ar9003_hw_eeprom_get_ht40_tgt_pwr(ah, HT_TARGET_RATE_23, freq,
is2GHz) + ht40PowerIncForPdadc;
- while (i < ar9300RateSize) {
- ath_dbg(common, ATH_DBG_EEPROM,
- "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
- i++;
-
- ath_dbg(common, ATH_DBG_EEPROM,
- "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
- i++;
-
- ath_dbg(common, ATH_DBG_EEPROM,
- "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
- i++;
-
+ for (i = 0; i < ar9300RateSize; i++) {
ath_dbg(common, ATH_DBG_EEPROM,
"TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
- i++;
}
}
@@ -4689,17 +4676,7 @@ static void ath9k_hw_ar9300_set_txpower(struct ath_hw *ah,
for (i = 0; i < ar9300RateSize; i++) {
ath_dbg(common, ATH_DBG_EEPROM,
- "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
- i++;
- ath_dbg(common, ATH_DBG_EEPROM,
- "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
- i++;
- ath_dbg(common, ATH_DBG_EEPROM,
- "TPC[%02d] 0x%08x ", i, targetPowerValT2[i]);
- i++;
- ath_dbg(common, ATH_DBG_EEPROM,
- "TPC[%02d] 0x%08x\n\n", i, targetPowerValT2[i]);
- i++;
+ "TPC[%02d] 0x%08x\n", i, targetPowerValT2[i]);
}
/*
--
1.7.3.2.245.g03276.dirty
next prev parent reply other threads:[~2010-12-03 3:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-02 5:13 [PATCH 1/2] ath: Fix ath_dbg uses missing newlines and " Joe Perches
2010-12-02 5:13 ` [PATCH 2/2] ath: Fix logging message typos Joe Perches
2010-12-02 5:30 ` [ath9k-devel] " Peter Stuge
2010-12-02 5:34 ` Joe Perches
2010-12-02 6:01 ` Nick Kossifidis
2010-12-02 5:35 ` [PATCH 2/2 V2] " Joe Perches
2010-12-02 19:02 ` [PATCH 1/2] ath: Fix ath_dbg uses missing newlines and access beyond array bound Luis R. Rodriguez
2010-12-03 3:12 ` [PATCH 0/4] ath: logging message conversion Joe Perches
2010-12-03 3:12 ` [PATCH 1/4] ath: Add and use ath_printk and ath_<level> Joe Perches
2010-12-07 21:38 ` John W. Linville
2010-12-03 3:12 ` [PATCH 2/4] ath: Convert ath_print(.., ATH_DBG_FATAL to ath_err Joe Perches
2010-12-03 3:12 ` [PATCH 3/4] ath: Convert ath_print to ath_dbg Joe Perches
2010-12-03 3:12 ` Joe Perches [this message]
2010-12-07 19:05 ` [PATCH 0/4] ath: logging message conversion John W. Linville
2010-12-07 19:26 ` Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f27b95daeb152de787dea20e4eefd21e65a7108e.1291333544.git.joe@perches.com \
--to=joe@perches.com \
--cc=ath9k-devel@venema.h4ckr.net \
--cc=jmalinen@atheros.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=lrodriguez@atheros.com \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.org \
--cc=peter@stuge.se \
--cc=senthilkumar@atheros.com \
--cc=vasanth@atheros.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®