aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-10-20 02:37:47 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-20 02:37:47 -0400
commit9f3ffae0dbce491a3e9871b686342fd5aa854f05 (patch)
treedc6aaa3fba97e750a79c7717758472d954ab207c
parent944f750227fa0beb2b440709687415621e2533a4 (diff)
pkt_sched: sch_generic: Fix oops in sch_teql
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>
-rw-r--r--net/sched/sch_generic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 7b5572d6beb5..93cd30ce6501 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -326,6 +326,7 @@ struct Qdisc_ops noop_qdisc_ops __read_mostly = {
326 326
327static struct netdev_queue noop_netdev_queue = { 327static struct netdev_queue noop_netdev_queue = {
328 .qdisc = &noop_qdisc, 328 .qdisc = &noop_qdisc,
329 .qdisc_sleeping = &noop_qdisc,
329}; 330};
330 331
331struct Qdisc noop_qdisc = { 332struct Qdisc noop_qdisc = {
@@ -352,6 +353,7 @@ static struct Qdisc_ops noqueue_qdisc_ops __read_mostly = {
352static struct Qdisc noqueue_qdisc; 353static struct Qdisc noqueue_qdisc;
353static struct netdev_queue noqueue_netdev_queue = { 354static struct netdev_queue noqueue_netdev_queue = {
354 .qdisc = &noqueue_qdisc, 355 .qdisc = &noqueue_qdisc,
356 .qdisc_sleeping = &noqueue_qdisc,
355}; 357};
356 358
357static struct Qdisc noqueue_qdisc = { 359static struct Qdisc noqueue_qdisc = {