All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: Patrick McHardy <kaber@trash.net>, netfilter-devel@vger.kernel.org
Subject: netfilter 06/06: nf_conntrack_extend: avoid unnecessary "ct->ext" dereferences
Date: Sun, 27 Jul 2008 01:37:15 +0200 (MEST)	[thread overview]
Message-ID: <20080726233714.15283.89711.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080726233705.15283.38364.sendpatchset@localhost.localdomain>

netfilter: nf_conntrack_extend: avoid unnecessary "ct->ext" dereferences

As Linus points out, "ct->ext" and "new" are always equal, avoid unnecessary
dereferences and use "new" directly.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit d928bf64722c65a7723ebff4161c4ca1256db6cf
tree 0f9bf278b49529096f187b48b286f4dbe3c289b5
parent dfecb922fa57237ef11bad7b95cbbceb5fdaccce
author Patrick McHardy <kaber@trash.net> Sun, 27 Jul 2008 00:40:14 +0200
committer Patrick McHardy <kaber@trash.net> Sun, 27 Jul 2008 00:40:14 +0200

 net/netfilter/nf_conntrack_extend.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
index c956ef7..4b2c769 100644
--- a/net/netfilter/nf_conntrack_extend.c
+++ b/net/netfilter/nf_conntrack_extend.c
@@ -115,10 +115,10 @@ void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp)
 		ct->ext = new;
 	}
 
-	ct->ext->offset[id] = newoff;
-	ct->ext->len = newlen;
-	memset((void *)ct->ext + newoff, 0, newlen - newoff);
-	return (void *)ct->ext + newoff;
+	new->offset[id] = newoff;
+	new->len = newlen;
+	memset((void *)new + newoff, 0, newlen - newoff);
+	return (void *)new + newoff;
 }
 EXPORT_SYMBOL(__nf_ct_ext_add);
 

  parent reply	other threads:[~2008-07-26 23:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-26 23:37 netfilter 00/06: netfilter update Patrick McHardy
2008-07-26 23:37 ` netfilter 01/06: ebtables: use nf_register_hooks() Patrick McHardy
2008-07-27  0:48   ` David Miller
2008-07-26 23:37 ` selinux 02/06: " Patrick McHardy
2008-07-27  0:48   ` David Miller
2008-07-26 23:37 ` netfilter 03/06: ip{,6}tables_security: fix future section mismatch Patrick McHardy
2008-07-27  0:48   ` David Miller
2008-07-26 23:37 ` netfilter 04/06: arptables in netns for real Patrick McHardy
2008-07-27  0:49   ` David Miller
2008-07-26 23:37 ` netfilter 05/06: fix double-free and use-after free Patrick McHardy
2008-07-27  0:49   ` David Miller
2008-07-26 23:37 ` Patrick McHardy [this message]
2008-07-27  0:50   ` netfilter 06/06: nf_conntrack_extend: avoid unnecessary "ct->ext" dereferences David 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=20080726233714.15283.89711.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.