ath9k: downgrade assert in rc.c for invalid rate
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 15 Jul 2009 00:13:54 +0000 (20:13 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 24 Jul 2009 19:05:14 +0000 (15:05 -0400)
The case where no vaid rate is found should not happen now
but to help debugging and downgrade this to a warn.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/rc.c

index ba06e78b2f500c0f3522a207de16ace6bc43ac8e..d7f403080f7a8c0fd04fd6d31083cb111c13a99e 100644 (file)
@@ -741,10 +741,18 @@ static u8 ath_rc_ratefind_ht(struct ath_softc *sc,
        if (rate > (ath_rc_priv->rate_table_size - 1))
                rate = ath_rc_priv->rate_table_size - 1;
 
-       ASSERT((rate_table->info[rate].valid &&
-               (ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG)) ||
-              (rate_table->info[rate].valid_single_stream &&
-               !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG)));
+       if (rate_table->info[rate].valid &&
+           (ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG))
+               return rate;
+
+       if (rate_table->info[rate].valid_single_stream &&
+           !(ath_rc_priv->ht_cap & WLAN_RC_DS_FLAG));
+               return rate;
+
+       /* This should not happen */
+       WARN_ON(1);
+
+       rate = ath_rc_priv->valid_rate_index[0];
 
        return rate;
 }