Skip to content
Snippets Groups Projects
Commit a5e70c13 authored by Felix Fietkau's avatar Felix Fietkau
Browse files

mac80211: fix a crash in legacy minstrel when no STA exists


Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>

SVN-Revision: 37342
parent 93cb8622
No related branches found
No related tags found
No related merge requests found
......@@ -779,3 +779,22 @@
}
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;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment