Message ID | 20231120130613.4659-1-mheyne@amazon.de (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [4.14] net: sched: fix race condition in qdisc_graft() | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply, async |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index f305eb44bf36..165823ab13d6 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -938,12 +938,13 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, skip: if (!ingress) { - notify_and_destroy(net, skb, n, classid, - dev->qdisc, new); + old = dev->qdisc; if (new && !new->ops->attach) qdisc_refcount_inc(new); dev->qdisc = new ? : &noop_qdisc; + notify_and_destroy(net, skb, n, classid, old, new); + if (new && new->ops->attach) new->ops->attach(new); } else {