Search Linux Wireless

Re: [PATCH] ath5k: avoid oops when ah_capabilities.cap_mode not set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux