Return-path: Received: from mfe1.polimi.it ([131.175.12.23]:60238 "EHLO polimi.it" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750915AbYAPXpz (ORCPT ); Wed, 16 Jan 2008 18:45:55 -0500 Date: Thu, 17 Jan 2008 00:38:29 +0100 From: Stefano Brivio To: "John W. Linville" Cc: Michael Buesch , Mattias Nissler , linux-wireless@vger.kernel.org Subject: rc80211-pid: fix last_sample initialization Message-ID: <20080117003829.6d1c15cc@morte> (sfid-20080116_234603_943915_85DD4A0B) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-wireless-owner@vger.kernel.org List-ID: 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 --- Index: wireless-2.6/net/mac80211/rc80211_pid_algo.c =================================================================== --- wireless-2.6.orig/net/mac80211/rc80211_pid_algo.c +++ wireless-2.6/net/mac80211/rc80211_pid_algo.c @@ -496,6 +496,8 @@ static void *rate_control_pid_alloc_sta( 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); -- Ciao Stefano