netif_set_real_num_tx_queues() can be called when netdev is up.That usually happens when user requests change of number ofchannels/rings with ethtool -L. The procedure for changingthe number of queues involves resetting the qdiscs and settingdev->num_tx_queues to the new value. When the new value islower than the old one, extra care has to be taken to ensureordering of accesses to the number of queues vs qdisc reset.

Currently the queues are reset before new dev->num_tx_queuesis assigned, leaving a window of time where packets can beenqueued onto the queues going down, leading to a likelycrash in the drivers, since most drivers don't check if TXskbs are assigned to an active queue.