diff options
author | Jarek Poplawski <jarkao2@gmail.com> | 2008-10-19 23:37:47 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-11-06 19:05:41 -0800 |
commit | 9a8eac41549d7ae0e40744177edd8dc8d59592e4 (patch) | |
tree | 63c5bfcb30b7c85ba8012e8533e3b48c2211b800 | |
parent | a331c85a4d4b4d150d1cd9217aec376cabedd0bf (diff) |
pkt_sched: sch_generic: Fix oops in sch_teql
[ Upstream commit 9f3ffae0dbce491a3e9871b686342fd5aa854f05 ]
After these commands:
# modprobe sch_teql
# tc qdisc add dev eth0 root teql0
# tc qdisc del dev eth0 root
we get an oops in teql_destroy() when spin_lock is taken from a null
qdisc_sleeping pointer. It's because at the moment teql0 dev haven't
been activated yet, and a qdisc_root_sleeping() is pointing to noop
qdisc's netdev_queue with qdisc_sleeping uninitialized. This patch
fixes this both for noop and noqueue netdev_queues to avoid similar
problems in the future.
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | net/sched/sch_generic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index ec0a0839ce51..700ae9e30b57 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -319,6 +319,7 @@ struct Qdisc_ops noop_qdisc_ops __read_mostly = { static struct netdev_queue noop_netdev_queue = { .qdisc = &noop_qdisc, + .qdisc_sleeping = &noop_qdisc, }; struct Qdisc noop_qdisc = { @@ -344,6 +345,7 @@ static struct Qdisc_ops noqueue_qdisc_ops __read_mostly = { static struct Qdisc noqueue_qdisc; static struct netdev_queue noqueue_netdev_queue = { .qdisc = &noqueue_qdisc, + .qdisc_sleeping = &noqueue_qdisc, }; static struct Qdisc noqueue_qdisc = { |