From: Evgeniy Polyakov Date: Tue, 13 Nov 2007 08:07:45 +0000 (-0800) Subject: Fix TEQL oops. X-Git-Tag: v2.6.22.14~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d23541246308b5d2867c6592ad2b09e9a1ae344;p=thirdparty%2Fkernel%2Fstable.git Fix TEQL oops. [PKT_SCHED]: Fix OOPS when removing devices from a teql queuing discipline [ Upstream commit: 4f9f8311a08c0d95c70261264a2b47f2ae99683a ] 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index f05ad9a30b4cd..656ccd919d3c6 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c @@ -263,6 +263,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->hard_header == NULL || skb->dst == NULL || skb->dst->neighbour == NULL)