pinsched: Update next_txq pointer when destroying pinqueue.
When a packet-in queue is destroyed, update next_txq if it is referencing
the destroyed queue. NULL is a valid value for next_txq.
@@ -94,6 +94,12 @@ adjust_limits(int *rate_limit, int *burst_limit)
static void
pinqueue_destroy(struct pinsched *ps, struct pinqueue *q)
{
+ if (ps->next_txq == q) {
+ advance_txq(ps);
+ if (ps->next_txq == q) {
+ ps->next_txq = NULL;
+ }
+ }
hmap_remove(&ps->queues, &q->node);
free(q);
}
