netfilter: nf_conntrack_extend: avoid unnecessary "ct->ext" dereferences
authorPatrick McHardy <kaber@trash.net>
Sun, 27 Jul 2008 00:50:05 +0000 (17:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Jul 2008 00:50:05 +0000 (17:50 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nf_conntrack_extend.c

index c956ef7eeecbf3c3940f95ac027d7f197a85a5aa..4b2c769d555fce4d6131b08f5aac6d53b3a48be6 100644 (file)
@@ -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);