]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NET]: Fix gen_estimator timer removal race
authorPatrick McHardy <kaber@trash.net>
Mon, 9 Jul 2007 22:30:19 +0000 (15:30 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 11 Jul 2007 05:19:03 +0000 (22:19 -0700)
As noticed by Jarek Poplawski <jarkao2@o2.pl>, the timer removal in
gen_kill_estimator races with the timer function rearming the timer.

Check whether the timer list is empty before rearming the timer
in the timer function to fix this.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Acked-by: Jarek Poplawski <jarkao2@o2.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/gen_estimator.c

index 17daf4c9f79384ad0005fbec5780cc8bd6f63321..cc84d8d8a3c7d6c6c6e06a18080cfb99c50d86fa 100644 (file)
@@ -128,7 +128,8 @@ static void est_timer(unsigned long arg)
                spin_unlock(e->stats_lock);
        }
 
-       mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4));
+       if (elist[idx].list != NULL)
+               mod_timer(&elist[idx].timer, jiffies + ((HZ<<idx)/4));
        read_unlock(&est_lock);
 }