aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/sch_api.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 692d9a41cd23..c6e4063f698c 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -693,13 +693,18 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
693 if (new && i > 0) 693 if (new && i > 0)
694 atomic_inc(&new->refcnt); 694 atomic_inc(&new->refcnt);
695 695
696 qdisc_destroy(old); 696 if (!ingress)
697 qdisc_destroy(old);
697 } 698 }
698 699
699 notify_and_destroy(skb, n, classid, dev->qdisc, new); 700 if (!ingress) {
700 if (new && !new->ops->attach) 701 notify_and_destroy(skb, n, classid, dev->qdisc, new);
701 atomic_inc(&new->refcnt); 702 if (new && !new->ops->attach)
702 dev->qdisc = new ? : &noop_qdisc; 703 atomic_inc(&new->refcnt);
704 dev->qdisc = new ? : &noop_qdisc;
705 } else {
706 notify_and_destroy(skb, n, classid, old, new);
707 }
703 708
704 if (dev->flags & IFF_UP) 709 if (dev->flags & IFF_UP)
705 dev_activate(dev); 710 dev_activate(dev);