netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: jamal <hadi@cyberus.ca>
Cc: Maillist netdev <netdev@oss.sgi.com>
Subject: [PATCH PKT_SCHED 7/17]: Remove checks for impossible conditions in gact action
Date: Thu, 30 Dec 2004 04:39:59 +0100	[thread overview]
Message-ID: <41D3788F.7030501@trash.net> (raw)

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

a->priv can only be NULL in tcf_gact_cleanup, everything else _is_
a bug, so let's just crash so we get a backtrace.


[-- Attachment #2: 07.diff --]
[-- Type: text/x-patch, Size: 1703 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/30 02:25:13+01:00 kaber@coreworks.de 
#   [PKT_SCHED]: Remove checks for impossible conditions in gact action
#   
#   a->priv can only be NULL in tcf_gact_cleanup, everything else _is_ a
#   bug, so let's just crash so we get a backtrace.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   
# 
# net/sched/gact.c
#   2004/12/30 02:25:07+01:00 kaber@coreworks.de +1 -12
#   [PKT_SCHED]: Remove checks for impossible conditions in gact action
#   
#   a->priv can only be NULL in tcf_gact_cleanup, everything else _is_ a
#   bug, so let's just crash so we get a backtrace.
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
#   
# 
diff -Nru a/net/sched/gact.c b/net/sched/gact.c
--- a/net/sched/gact.c	2004-12-30 04:01:24 +01:00
+++ b/net/sched/gact.c	2004-12-30 04:01:24 +01:00
@@ -85,7 +85,7 @@
 	if (rtattr_parse(tb, TCA_GACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
 		return -1;
 
-	if (a == NULL || tb[TCA_GACT_PARMS - 1] == NULL) {
+	if (tb[TCA_GACT_PARMS - 1] == NULL) {
 		printk("BUG: tcf_gact_init called with NULL params\n");
 		return -1;
 	}
@@ -140,12 +140,6 @@
 	struct sk_buff *skb = *pskb;
 	int action = TC_ACT_SHOT;
 
-	if (p == NULL) {
-		if (net_ratelimit())
-			printk("BUG: tcf_gact called with NULL params\n");
-		return -1;
-	}
-
 	spin_lock(&p->lock);
 #ifdef CONFIG_GACT_PROB
 	if (p->ptype && gact_rand[p->ptype] != NULL)
@@ -175,11 +169,6 @@
 #endif
 	struct tcf_gact *p = PRIV(a, gact);
 	struct tcf_t t;
-
-	if (p == NULL) {
-		printk("BUG: tcf_gact_dump called with NULL params\n");
-		goto rtattr_failure;
-	}
 
 	opt.index = p->index;
 	opt.refcnt = p->refcnt - ref;

                 reply	other threads:[~2004-12-30  3:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=41D3788F.7030501@trash.net \
    --to=kaber@trash.net \
    --cc=hadi@cyberus.ca \
    --cc=netdev@oss.sgi.com \
    /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).