mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mac80211/minstrel: fix NULL pointer dereference issue
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]>
This commit is contained in:
parent
6b0f32745d
commit
5c9fc93bc9
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue