aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/sched/sch_tbf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index e9e47345736..d8e03c74ca7 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -341,13 +341,14 @@ static int tbf_change(struct Qdisc* sch, struct rtattr *opt)
if (max_size < 0)
goto done;
- if (q->qdisc == &noop_qdisc) {
+ if (qopt->limit > 0) {
if ((child = tbf_create_dflt_qdisc(sch->dev, qopt->limit)) == NULL)
goto done;
}
sch_tree_lock(sch);
- if (child) q->qdisc = child;
+ if (child)
+ qdisc_destroy(xchg(&q->qdisc, child));
q->limit = qopt->limit;
q->mtu = qopt->mtu;
q->max_size = max_size;