mac80211: fix a crash in legacy minstrel when no STA exists
authorFelix Fietkau <nbd@openwrt.org>
Mon, 15 Jul 2013 12:35:23 +0000 (12:35 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 15 Jul 2013 12:35:23 +0000 (12:35 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 37342

package/kernel/mac80211/patches/300-pending_work.patch

index b35f5c60360bc3099853729e2b6ad916d76bf7d6..c5a61bb7d52cf74947fe7d9c441a8a674601d542 100644 (file)
  }
  
  static int cfg80211_sme_connect(struct wireless_dev *wdev,
+--- a/net/mac80211/rc80211_minstrel.c
++++ b/net/mac80211/rc80211_minstrel.c
+@@ -290,7 +290,7 @@ minstrel_get_rate(void *priv, struct iee
+       struct minstrel_rate *msr, *mr;
+       unsigned int ndx;
+       bool mrr_capable;
+-      bool prev_sample = mi->prev_sample;
++      bool prev_sample;
+       int delta;
+       int sampling_ratio;
+@@ -314,6 +314,7 @@ minstrel_get_rate(void *priv, struct iee
+                       (mi->sample_count + mi->sample_deferred / 2);
+       /* delta < 0: no sampling required */
++      prev_sample = mi->prev_sample;
+       mi->prev_sample = false;
+       if (delta < 0 || (!mrr_capable && prev_sample))
+               return;