Commit 4ef6acff authored by John Fastabend's avatar John Fastabend Committed by David S. Miller

sched: qdisc_reset_all_tx is calling qdisc_reset without qdisc_lock

When calling qdisc_reset() the qdisc lock needs to be held.  In
this case there is at least one driver i4l which is using this
without holding the lock.  Add the locking here.
Signed-off-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ae80abd
...@@ -317,8 +317,16 @@ extern void tcf_destroy_chain(struct tcf_proto **fl); ...@@ -317,8 +317,16 @@ extern void tcf_destroy_chain(struct tcf_proto **fl);
static inline void qdisc_reset_all_tx(struct net_device *dev) static inline void qdisc_reset_all_tx(struct net_device *dev)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < dev->num_tx_queues; i++) struct Qdisc *qdisc;
qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc);
for (i = 0; i < dev->num_tx_queues; i++) {
qdisc = netdev_get_tx_queue(dev, i)->qdisc;
if (qdisc) {
spin_lock_bh(qdisc_lock(qdisc));
qdisc_reset(qdisc);
spin_unlock_bh(qdisc_lock(qdisc));
}
}
} }
/* Are all TX queues of the device empty? */ /* Are all TX queues of the device empty? */
......
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