On 06/17/2010 09:16 PM, Bob Copeland wrote:
On Thu, Jun 17, 2010 at 12:49:51PM -0600, Steve Brown wrote:
I went a little further and tested the following patch.
If it makes sense to you, I'll submit it.
So I looked over the code and found a few more trouble spots.
What about something like this instead? It shouldn't hurt to
use a default channel but could avoid another round or two of
whack-a-mole...
From: Bob Copeland<me@xxxxxxxxxxxxxxx>
Date: Thu, 17 Jun 2010 23:05:55 -0400
Subject: [PATCH] ath5k: initialize ah->ah_current_channel
ath5k assumes ah_current_channel is always a valid pointer in
several places, but a newly created interface may not have a
channel. To avoid null pointer dereferences, set it up to point
to the first available channel until later reconfigured.
Signed-off-by: Bob Copeland<me@xxxxxxxxxxxxxxx>
---
drivers/net/wireless/ath/ath5k/attach.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
index ef2dc1d..b32e28c 100644
--- a/drivers/net/wireless/ath/ath5k/attach.c
+++ b/drivers/net/wireless/ath/ath5k/attach.c
@@ -126,6 +126,7 @@ int ath5k_hw_attach(struct ath5k_softc *sc)
ah->ah_ant_mode = AR5K_ANTMODE_DEFAULT;
ah->ah_noise_floor = -95; /* until first NF calibration is run */
sc->ani_state.ani_mode = ATH5K_ANI_MODE_AUTO;
+ ah->ah_current_channel =&sc->channels[0];
/*
* Find the mac version
Applied and tested. Works.
Thanks,
Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html