nfsd: move fsid_type choice out of fh_compose
[safe/jmp/linux-2.6] / net / mac80211 / rc80211_minstrel.c
index 5196006..37771ab 100644 (file)
@@ -66,7 +66,7 @@ rix_to_ndx(struct minstrel_sta_info *mi, int rix)
        for (i = rix; i >= 0; i--)
                if (mi->r[i].rix == rix)
                        break;
-       WARN_ON(mi->r[i].rix != rix);
+       WARN_ON(i < 0);
        return i;
 }
 
@@ -181,6 +181,9 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
                        break;
 
                ndx = rix_to_ndx(mi, ar[i].idx);
+               if (ndx < 0)
+                       continue;
+
                mi->r[ndx].attempts += ar[i].count;
 
                if ((i != IEEE80211_TX_MAX_RATES - 1) && (ar[i + 1].idx < 0))
@@ -215,7 +218,7 @@ minstrel_get_next_sample(struct minstrel_sta_info *mi)
        unsigned int sample_ndx;
        sample_ndx = SAMPLE_TBL(mi, mi->sample_idx, mi->sample_column);
        mi->sample_idx++;
-       if (mi->sample_idx > (mi->n_rates - 2)) {
+       if ((int) mi->sample_idx > (mi->n_rates - 2)) {
                mi->sample_idx = 0;
                mi->sample_column++;
                if (mi->sample_column >= SAMPLE_COLUMNS)
@@ -478,8 +481,8 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
                return NULL;
 
        for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
-               sband = hw->wiphy->bands[hw->conf.channel->band];
-               if (sband->n_bitrates > max_rates)
+               sband = hw->wiphy->bands[i];
+               if (sband && sband->n_bitrates > max_rates)
                        max_rates = sband->n_bitrates;
        }