]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sched/sch_htb.c
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / net / sched / sch_htb.c
index 7bcf20ef914538af4147419d988112ab1bc83c62..8184c87da8bec7d93ac29d2c8c4259ad79e9f1c4 100644 (file)
@@ -1302,6 +1302,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
        struct htb_class *cl = (struct htb_class *)*arg, *parent;
        struct nlattr *opt = tca[TCA_OPTIONS];
        struct nlattr *tb[TCA_HTB_MAX + 1];
+       struct Qdisc *parent_qdisc = NULL;
        struct tc_htb_opt *hopt;
        u64 rate64, ceil64;
        int warn = 0;
@@ -1401,7 +1402,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
                if (parent && !parent->level) {
                        /* turn parent into inner node */
                        qdisc_purge_queue(parent->leaf.q);
-                       qdisc_put(parent->leaf.q);
+                       parent_qdisc = parent->leaf.q;
                        if (parent->prio_activity)
                                htb_deactivate(q, parent);
 
@@ -1480,6 +1481,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
        cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer);
 
        sch_tree_unlock(sch);
+       qdisc_put(parent_qdisc);
 
        if (warn)
                pr_warn("HTB: quantum of class %X is %s. Consider r2q change.\n",