]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Fix TEQL oops.
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Tue, 13 Nov 2007 08:07:45 +0000 (00:07 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Nov 2007 16:27:37 +0000 (08:27 -0800)
[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 <johnpol@2ka.mipt.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/sched/sch_teql.c

index 0968184ea6becc6f58ba848fc76c629aa8e26126..cb5754ba5ba439e3103ff627fb73c428cd0f8c71 100644 (file)
@@ -249,6 +249,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)