Skip to contentSkip to conversation

rc80211-pid: fix last_sample initialization

PATCH Stefano Brivio 2 participants 2 messages Jan 16, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

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.

---

net/mac80211/rc80211_pid_algo.c +2 -0
Index: 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);
Signature · 2 lines
Ciao
Stefano
#1 lore raw
Quoted 8 lines · Stefano Brivio

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.

Ack.

Quoted 16 lines

---
Index: wireless-2.6/net/mac80211/rc80211_pid_algo.c
===================================================================

net/mac80211/rc80211_pid_algo.c +2 -0
@@ -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);