netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: Thomas Graf <tgraf@suug.ch>, netdev@oss.sgi.com
Subject: [PATCH 2.4]: Don't try to destroy builtin qdiscs
Date: Fri, 05 Nov 2004 20:46:31 +0100	[thread overview]
Message-ID: <418BD897.5000409@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 63 bytes --]

Backported from Thomas's patch, we also need this for 2.4.





[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1124 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/11/05 20:44:30+01:00 kaber@coreworks.de 
#   [PKT_SCHED]: Don't try to destroy builtin qdiscs
#   
#   Backported from Thomas Graf's fix for 2.6.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/sched/sch_generic.c
#   2004/11/05 20:44:28+01:00 kaber@coreworks.de +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@trash.net>
# 
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);
 }
 
 

             reply	other threads:[~2004-11-05 19:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-05 19:46 Patrick McHardy [this message]
2004-11-06  0:49 ` [PATCH 2.4]: Don't try to destroy builtin qdiscs David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=418BD897.5000409@trash.net \
    --to=kaber@trash.net \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).