All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ath5k: fix buffer overrun in rate debug code
@ 2009-04-28  2:18 Bob Copeland
  2009-04-28  2:18 ` [PATCH 2/2] ath5k: correct interrupt storm warning Bob Copeland
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Copeland @ 2009-04-28  2:18 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath5k-devel, Bob Copeland

char bname[5] is too small for the string "X GHz" when the null
terminator is taken into account.  Thus, turning on rate debugging
can crash unless we have lucky stack alignment.

Reported-by: Paride Legovini <legovini@spiro.fisica.unipd.it>
Signed-off-by: Bob Copeland <me@bobcopeland.com>

---
 drivers/net/wireless/ath/ath5k/debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 9770bb3..4904a07 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -424,7 +424,7 @@ ath5k_debug_dump_bands(struct ath5k_softc *sc)
 
 	for (b = 0; b < IEEE80211_NUM_BANDS; b++) {
 		struct ieee80211_supported_band *band = &sc->sbands[b];
-		char bname[5];
+		char bname[6];
 		switch (band->band) {
 		case IEEE80211_BAND_2GHZ:
 			strcpy(bname, "2 GHz");
-- 
1.6.0.6



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] ath5k: correct interrupt storm warning
  2009-04-28  2:18 [PATCH 1/2] ath5k: fix buffer overrun in rate debug code Bob Copeland
@ 2009-04-28  2:18 ` Bob Copeland
  0 siblings, 0 replies; 2+ messages in thread
From: Bob Copeland @ 2009-04-28  2:18 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath5k-devel, Bob Copeland, Ben Greear

Ben Greear points out that the "too many interrupts" message will
never print in the intended case since the interrupt counter
will be -1 after the loop.  Change it to pre-decrement so it will
be 0 on the thousandth iteration.

Cc: Ben Greear <greearb@candelatech.com>

Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index ff05ee9..a546465 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2525,7 +2525,7 @@ ath5k_intr(int irq, void *dev_id)
 				ath5k_hw_update_mib_counters(ah, &sc->ll_stats);
 			}
 		}
-	} while (ath5k_hw_is_intr_pending(ah) && counter-- > 0);
+	} while (ath5k_hw_is_intr_pending(ah) && --counter > 0);
 
 	if (unlikely(!counter))
 		ATH5K_WARN(sc, "too many interrupts, giving up for now\n");
-- 
1.6.0.6



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-28  2:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-28  2:18 [PATCH 1/2] ath5k: fix buffer overrun in rate debug code Bob Copeland
2009-04-28  2:18 ` [PATCH 2/2] ath5k: correct interrupt storm warning Bob Copeland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.