diff options
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r-- | net/sched/sch_generic.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index e244c462e6bd..14cc443d0490 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -480,15 +480,12 @@ static void __qdisc_destroy(struct rcu_head *head) | |||
480 | 480 | ||
481 | void qdisc_destroy(struct Qdisc *qdisc) | 481 | void qdisc_destroy(struct Qdisc *qdisc) |
482 | { | 482 | { |
483 | struct net_device *dev = qdisc_dev(qdisc); | ||
484 | |||
485 | if (qdisc->flags & TCQ_F_BUILTIN || | 483 | if (qdisc->flags & TCQ_F_BUILTIN || |
486 | !atomic_dec_and_test(&qdisc->refcnt)) | 484 | !atomic_dec_and_test(&qdisc->refcnt)) |
487 | return; | 485 | return; |
488 | 486 | ||
489 | spin_lock_bh(&dev->qdisc_list_lock); | 487 | if (qdisc->parent) |
490 | list_del(&qdisc->list); | 488 | list_del(&qdisc->list); |
491 | spin_unlock_bh(&dev->qdisc_list_lock); | ||
492 | 489 | ||
493 | call_rcu(&qdisc->q_rcu, __qdisc_destroy); | 490 | call_rcu(&qdisc->q_rcu, __qdisc_destroy); |
494 | } | 491 | } |
@@ -520,9 +517,6 @@ static void attach_one_default_qdisc(struct net_device *dev, | |||
520 | printk(KERN_INFO "%s: activation failed\n", dev->name); | 517 | printk(KERN_INFO "%s: activation failed\n", dev->name); |
521 | return; | 518 | return; |
522 | } | 519 | } |
523 | spin_lock_bh(&dev->qdisc_list_lock); | ||
524 | list_add_tail(&qdisc->list, &dev->qdisc_list); | ||
525 | spin_unlock_bh(&dev->qdisc_list_lock); | ||
526 | } else { | 520 | } else { |
527 | qdisc = &noqueue_qdisc; | 521 | qdisc = &noqueue_qdisc; |
528 | } | 522 | } |