]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PKT_SCHED]: Fix OOPS when removing devices from a teql queuing discipline
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>
Tue, 6 Nov 2007 11:08:09 +0000 (03:08 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 7 Nov 2007 12:09:17 +0000 (04:09 -0800)
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>
net/sched/sch_teql.c

index 421281d9dd1d3f9103b17c71b68b0d927d3807da..c0ed06d4a5046516c1e67d2b8f15df2aca07ae8b 100644 (file)
@@ -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)