diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2009-09-14 00:35:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-15 02:03:57 +0200 |
commit | 036d6a673fa0a2e2c5b72a3b1d1b86114c1711c0 (patch) | |
tree | e74fea79b646540d2e766710121459925e3d8922 | |
parent | igb: do not allow phy sw reset code to make calls to null pointers (diff) | |
download | linux-036d6a673fa0a2e2c5b72a3b1d1b86114c1711c0.tar.xz linux-036d6a673fa0a2e2c5b72a3b1d1b86114c1711c0.zip |
pkt_sched: Fix qdisc_graft WRT ingress qdisc
After the recent mq change using ingress qdisc overwrites dev->qdisc;
there is also a wrong old qdisc pointer passed to notify_and_destroy.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/sch_api.c | 15 |
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, if (new && i > 0) atomic_inc(&new->refcnt); - qdisc_destroy(old); + if (!ingress) + qdisc_destroy(old); } - notify_and_destroy(skb, n, classid, dev->qdisc, new); - if (new && !new->ops->attach) - atomic_inc(&new->refcnt); - dev->qdisc = new ? : &noop_qdisc; + if (!ingress) { + notify_and_destroy(skb, n, classid, dev->qdisc, new); + if (new && !new->ops->attach) + atomic_inc(&new->refcnt); + dev->qdisc = new ? : &noop_qdisc; + } else { + notify_and_destroy(skb, n, classid, old, new); + } if (dev->flags & IFF_UP) dev_activate(dev); |