netdev
[Top] [All Lists]

[PATCH 2.4]: Don't try to destroy builtin qdiscs

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: [PATCH 2.4]: Don't try to destroy builtin qdiscs
From: Patrick McHardy <kaber@xxxxxxxxx>
Date: Fri, 05 Nov 2004 20:46:31 +0100
Cc: Thomas Graf <tgraf@xxxxxxx>, netdev@xxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5
Backported from Thomas's patch, we also need this for 2.4.




# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/11/05 20:44:30+01:00 kaber@xxxxxxxxxxxx 
#   [PKT_SCHED]: Don't try to destroy builtin qdiscs
#   
#   Backported from Thomas Graf's fix for 2.6.
#   
#   Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
# 
# net/sched/sch_generic.c
#   2004/11/05 20:44:28+01:00 kaber@xxxxxxxxxxxx +3 -3
#   [PKT_SCHED]: Don't try to destroy builtin qdiscs
#   
#   Backported from Thomas Graf's fix for 2.6.
#   
#   Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
# 
diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c
--- a/net/sched/sch_generic.c   2004-11-05 20:44:43 +01:00
+++ b/net/sched/sch_generic.c   2004-11-05 20:44:43 +01:00
@@ -423,7 +423,8 @@
 {
        struct Qdisc_ops *ops = qdisc->ops;
 
-       if (!atomic_dec_and_test(&qdisc->refcnt))
+       if (qdisc->flags&TCQ_F_BUILTIN ||
+           !atomic_dec_and_test(&qdisc->refcnt))
                return;
        list_del(&qdisc->list);
 #ifdef CONFIG_NET_ESTIMATOR
@@ -433,8 +434,7 @@
                ops->reset(qdisc);
        if (ops->destroy)
                ops->destroy(qdisc);
-       if (!(qdisc->flags&TCQ_F_BUILTIN))
-               kfree(qdisc);
+       kfree(qdisc);
 }
 
 
<Prev in Thread] Current Thread [Next in Thread>