diff options
author | Thomas Graf <tgraf@suug.ch> | 2007-05-10 07:02:41 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-11 02:47:39 -0400 |
commit | 5830725f8a36908111ecccf2899d06d6dcf54d45 (patch) | |
tree | 5f06185bf908327f51e027ae35391215e6d80253 /net/sched/sch_generic.c | |
parent | fc038410b4b1643766f8033f4940bcdb1dace633 (diff) |
[NET]: Fix dev->qdisc race for NETDEV_TX_LOCKED case
When transmit fails with NETDEV_TX_LOCKED the skb is requeued
to dev->qdisc again. The dev->qdisc pointer is protected by
the queue lock which needs to be dropped when attempting to
transmit and acquired again before requeing. The problem is
that qdisc_restart() fetches the dev->qdisc pointer once and
stores it in the `q' variable which is invalidated when
dropping the queue_lock, therefore the variable needs to be
refreshed before requeueing.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r-- | net/sched/sch_generic.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 3385ee592541..a8240c578772 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -139,6 +139,7 @@ static inline int qdisc_restart(struct net_device *dev) | |||
139 | } | 139 | } |
140 | if (ret == NETDEV_TX_LOCKED && nolock) { | 140 | if (ret == NETDEV_TX_LOCKED && nolock) { |
141 | spin_lock(&dev->queue_lock); | 141 | spin_lock(&dev->queue_lock); |
142 | q = dev->qdisc; | ||
142 | goto collision; | 143 | goto collision; |
143 | } | 144 | } |
144 | } | 145 | } |