On Wed, Oct 17, 2007 at 05:36:33PM -0400, Luis R. Rodriguez wrote: > On 10/17/07, John W. Linville <linville@xxxxxxxxxxxxx> wrote: > > ah_capabilities.cap_mode doesn't get set for some cards, causing the > > kernel to oops when these unknown/unsupported cards are inserted. > > Add some NULL checks to avoid this. > > > > Signed-off-by: John W. Linville <linville@xxxxxxxxxxxxx> > > Acked-by: Luis R. Rodriguez <mcgrof@xxxxxxxxx> > Actually, this hunk in ath5k_getchannels can't return -EINVAL immediately, since there are ath5k cards that do only MODE_IEEE80211A, which is searched last. comments? cheers, Kyle --- a/drivers/net/wireless/ath5k/base.c 2007-11-20 18:35:37.000000000 -0500 +++ b/drivers/net/wireless/ath5k/base.c 2007-11-20 18:35:46.000000000 -0500 @@ -1041,6 +1041,8 @@ } hw_rates = ath5k_hw_get_rate_table(ah, mode->mode); + if (!hw_rates) + continue; mode->num_rates = ath5k_copy_rates(mode->rates, hw_rates, max_r); mode->num_channels = ath5k_copy_channels(ah, mode->channels, --- a/drivers/net/wireless/ath5k/hw.c 2007-11-20 18:35:34.000000000 -0500 +++ b/drivers/net/wireless/ath5k/hw.c 2007-11-20 18:36:08.000000000 -0500 @@ -536,6 +536,8 @@ /* Get rate table for the current operating mode */ rt = ath5k_hw_get_rate_table(ah, driver_mode); + if (!rt) + return -EINVAL; /* Write rate duration table */ for (i = 0; i < rt->rate_count; i++) { - 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