mac80211: avoid NULL ptr deref when finding max_rates in PID and minstrel
[safe/jmp/linux-2.6] / net / mac80211 / rc80211_minstrel.c
index 70df3dc..d9233ec 100644 (file)
@@ -477,7 +477,7 @@ minstrel_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
 
        for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
                sband = hw->wiphy->bands[i];
-               if (sband->n_bitrates > max_rates)
+               if (sband && sband->n_bitrates > max_rates)
                        max_rates = sband->n_bitrates;
        }