diff options
Diffstat (limited to 'net/sched/sch_tbf.c')
-rw-r--r-- | net/sched/sch_tbf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 2562a6040b76..23b7624354f5 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -348,8 +348,10 @@ static int tbf_change(struct Qdisc* sch, struct rtattr *opt) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | sch_tree_lock(sch); | 350 | sch_tree_lock(sch); |
351 | if (child) | 351 | if (child) { |
352 | qdisc_tree_decrease_qlen(q->qdisc, q->qdisc->q.qlen); | ||
352 | qdisc_destroy(xchg(&q->qdisc, child)); | 353 | qdisc_destroy(xchg(&q->qdisc, child)); |
354 | } | ||
353 | q->limit = qopt->limit; | 355 | q->limit = qopt->limit; |
354 | q->mtu = qopt->mtu; | 356 | q->mtu = qopt->mtu; |
355 | q->max_size = max_size; | 357 | q->max_size = max_size; |
@@ -451,8 +453,8 @@ static int tbf_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, | |||
451 | 453 | ||
452 | sch_tree_lock(sch); | 454 | sch_tree_lock(sch); |
453 | *old = xchg(&q->qdisc, new); | 455 | *old = xchg(&q->qdisc, new); |
456 | qdisc_tree_decrease_qlen(*old, (*old)->q.qlen); | ||
454 | qdisc_reset(*old); | 457 | qdisc_reset(*old); |
455 | sch->q.qlen = 0; | ||
456 | sch_tree_unlock(sch); | 458 | sch_tree_unlock(sch); |
457 | 459 | ||
458 | return 0; | 460 | return 0; |