Commit 5830725f authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[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: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc038410
...@@ -139,6 +139,7 @@ static inline int qdisc_restart(struct net_device *dev) ...@@ -139,6 +139,7 @@ static inline int qdisc_restart(struct net_device *dev)
} }
if (ret == NETDEV_TX_LOCKED && nolock) { if (ret == NETDEV_TX_LOCKED && nolock) {
spin_lock(&dev->queue_lock); spin_lock(&dev->queue_lock);
q = dev->qdisc;
goto collision; goto collision;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment