From c09c7237eadc65916305835ca1e3ee8a03f01159 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 17 Jan 2008 00:38:29 +0100 Subject: rc80211-pid: fix last_sample initialization 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 Signed-off-by: Stefano Brivio Signed-off-by: John W. Linville --- net/mac80211/rc80211_pid_algo.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'net/mac80211') diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index 962286d893d..554c4baed6f 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c @@ -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); -- cgit v1.2.3