From: Evgeniy Polyakov Date: Tue, 6 Nov 2007 11:08:09 +0000 (-0800) Subject: [PKT_SCHED]: Fix OOPS when removing devices from a teql queuing discipline X-Git-Tag: v2.6.24-rc3~179^2~24 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f9f8311a08c0d95c70261264a2b47f2ae99683a;p=linux-2.6 [PKT_SCHED]: Fix OOPS when removing devices from a teql queuing discipline tecl_reset() is called from deactivate and qdisc is set to noop already, but subsequent teql_xmit does not know about it and dereference private data as teql qdisc and thus oopses. not catch it first :) Signed-off-by: Evgeniy Polyakov Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 421281d9dd..c0ed06d4a5 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c @@ -252,6 +252,9 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device * static inline int teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev) { + if (dev->qdisc == &noop_qdisc) + return -ENODEV; + if (dev->header_ops == NULL || skb->dst == NULL || skb->dst->neighbour == NULL)