netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pkt_sched: sch_generic: Fix oops in sch_teql
@ 2008-10-18 23:09 Jarek Poplawski
  2008-10-20  6:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jarek Poplawski @ 2008-10-18 23:09 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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>
[regression in 2.6.27]
---

 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 7b5572d..93cd30c 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 = {
 
 static struct netdev_queue noop_netdev_queue = {
 	.qdisc		=	&noop_qdisc,
+	.qdisc_sleeping	=	&noop_qdisc,
 };
 
 struct Qdisc noop_qdisc = {
@@ -352,6 +353,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 = {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pkt_sched: sch_generic: Fix oops in sch_teql
  2008-10-18 23:09 [PATCH] pkt_sched: sch_generic: Fix oops in sch_teql Jarek Poplawski
@ 2008-10-20  6:38 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-10-20  6:38 UTC (permalink / raw)
  To: jarkao2; +Cc: netdev

From: Jarek Poplawski <jarkao2@gmail.com>
Date: Sun, 19 Oct 2008 01:09:38 +0200

> 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>
> [regression in 2.6.27]

Applied and will queue to -stable, thanks Jarek.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-20  6:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-18 23:09 [PATCH] pkt_sched: sch_generic: Fix oops in sch_teql Jarek Poplawski
2008-10-20  6:38 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).