aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2009-05-18 15:12:31 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-15 09:39:51 -0700
commitefe0627824eeb725500f76cdd28ce758d5d91fc7 (patch)
treefec774dac04fc086200388402901746a4e6e4b6c /net
parentd7a6c1b0a5d74c37ada244880779750eda1a370e (diff)
sch_teql: should not dereference skb after ndo_start_xmit()
[ Upstream commit c0f84d0d4be3f7d818b4ffb04d27f9bae64397f0 ] It is illegal to dereference a skb after a successful ndo_start_xmit() call. We must store skb length in a local variable instead. Bug was introduced in 2.6.27 by commit 0abf77e55a2459aa9905be4b226e4729d5b4f0cb (net_sched: Add accessor function for packet length for qdiscs) Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_teql.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index ec697cebb63..3b641829723 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -303,6 +303,8 @@ restart:
switch (teql_resolve(skb, skb_res, slave)) {
case 0:
if (__netif_tx_trylock(slave_txq)) {
+ unsigned int length = qdisc_pkt_len(skb);
+
if (!netif_tx_queue_stopped(slave_txq) &&
!netif_tx_queue_frozen(slave_txq) &&
slave_ops->ndo_start_xmit(skb, slave) == 0) {
@@ -310,8 +312,7 @@ restart:
master->slaves = NEXT_SLAVE(q);
netif_wake_queue(dev);
master->stats.tx_packets++;
- master->stats.tx_bytes +=
- qdisc_pkt_len(skb);
+ master->stats.tx_bytes += length;
return 0;
}
__netif_tx_unlock(slave_txq);