aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/sch_generic.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 03ca5d826757..ba749be1e354 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -317,8 +317,16 @@ extern void tcf_destroy_chain(struct tcf_proto **fl);
317static inline void qdisc_reset_all_tx(struct net_device *dev) 317static inline void qdisc_reset_all_tx(struct net_device *dev)
318{ 318{
319 unsigned int i; 319 unsigned int i;
320 for (i = 0; i < dev->num_tx_queues; i++) 320 struct Qdisc *qdisc;
321 qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc); 321
322 for (i = 0; i < dev->num_tx_queues; i++) {
323 qdisc = netdev_get_tx_queue(dev, i)->qdisc;
324 if (qdisc) {
325 spin_lock_bh(qdisc_lock(qdisc));
326 qdisc_reset(qdisc);
327 spin_unlock_bh(qdisc_lock(qdisc));
328 }
329 }
322} 330}
323 331
324/* Are all TX queues of the device empty? */ 332/* Are all TX queues of the device empty? */