Skip to content

Commit

Permalink
rc80211-pid: fix last_sample initialization
Browse files Browse the repository at this point in the history
Fix last_sample initialization. kzalloc'ing the per-STA data wasn't enough,
as jiffies can assume negative values as well. This fixes a bug which
prevented correct PID operation for a while after booting.

Thanks to Michael Buesch for reporting this.

Reported-and-tested-by: Michael Buesch <[email protected]>
Signed-off-by: Stefano Brivio <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
Stefano Brivio authored and davem330 committed Jan 28, 2008
1 parent f99b751 commit c09c723
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/mac80211/rc80211_pid_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ static void *rate_control_pid_alloc_sta(void *priv, gfp_t gfp)
if (spinfo == NULL)
return NULL;

spinfo->last_sample = jiffies;

#ifdef CONFIG_MAC80211_DEBUGFS
spin_lock_init(&spinfo->events.lock);
init_waitqueue_head(&spinfo->events.waitqueue);
Expand Down

0 comments on commit c09c723

Please sign in to comment.