projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b0f327
)
mac80211/minstrel: fix NULL pointer dereference issue
author
Felix Fietkau
<
[email protected]
>
Mon, 15 Jul 2013 12:35:06 +0000
(14:35 +0200)
committer
Johannes Berg
<
[email protected]
>
Tue, 16 Jul 2013 14:48:14 +0000
(17:48 +0300)
When priv_sta == NULL, mi->prev_sample is dereferenced too early. Move
the assignment further down, after the rate_control_send_low call.
Reported-by: Krzysztof Mazur <
[email protected]
>
Cc:
[email protected]
# 3.10
Signed-off-by: Felix Fietkau <
[email protected]
>
Signed-off-by: Johannes Berg <
[email protected]
>
net/mac80211/rc80211_minstrel.c
patch
|
blob
|
history
diff --git
a/net/mac80211/rc80211_minstrel.c
b/net/mac80211/rc80211_minstrel.c
index ac7ef5414bdede030d289a81946eaabc7b5d7a88..e6512e2ffd200223cd5cb75090802a98f544bb7d 100644
(file)
--- a/
net/mac80211/rc80211_minstrel.c
+++ b/
net/mac80211/rc80211_minstrel.c
@@
-290,7
+290,7
@@
minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
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 ieee80211_sta *sta,
(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;