Commit 4f9f8311a08c0d95c70261264a2b47f2ae99683a

Authored by Evgeniy Polyakov
Committed by David S. Miller
1 parent c62cf5cb17

[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 <johnpol@2ka.mipt.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

net/sched/sch_teql.c
... ... @@ -252,6 +252,9 @@
252 252 static inline int teql_resolve(struct sk_buff *skb,
253 253 struct sk_buff *skb_res, struct net_device *dev)
254 254 {
  255 + if (dev->qdisc == &noop_qdisc)
  256 + return -ENODEV;
  257 +
255 258 if (dev->header_ops == NULL ||
256 259 skb->dst == NULL ||
257 260 skb->dst->neighbour == NULL)