Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e43419f9 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville
Browse files

ath9k: downgrade assert in rc.c for invalid rate



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: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b770b43e
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -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;
}