Merge git://www.linux-watchdog.org/linux-watchdog
[linux-2.6-microblaze.git] / net / sched / sch_mqprio.c
index d44c868..6749e2f 100644 (file)
@@ -167,15 +167,17 @@ static void mqprio_attach(struct Qdisc *sch)
 {
        struct net_device *dev = qdisc_dev(sch);
        struct mqprio_sched *priv = qdisc_priv(sch);
-       struct Qdisc *qdisc;
+       struct Qdisc *qdisc, *old;
        unsigned int ntx;
 
        /* Attach underlying qdisc */
        for (ntx = 0; ntx < dev->num_tx_queues; ntx++) {
                qdisc = priv->qdiscs[ntx];
-               qdisc = dev_graft_qdisc(qdisc->dev_queue, qdisc);
-               if (qdisc)
-                       qdisc_destroy(qdisc);
+               old = dev_graft_qdisc(qdisc->dev_queue, qdisc);
+               if (old)
+                       qdisc_destroy(old);
+               if (ntx < dev->real_num_tx_queues)
+                       qdisc_list_add(qdisc);
        }
        kfree(priv->qdiscs);
        priv->qdiscs = NULL;