]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netfilter: conntrack: Remove redundant NFCT_ALIGN call
authorXuanqiang Luo <luoxuanqiang@kylinos.cn>
Fri, 4 Apr 2025 09:47:51 +0000 (17:47 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 28 Apr 2025 22:00:26 +0000 (00:00 +0200)
The "nf_ct_tmpl_alloc" function had a redundant call to "NFCT_ALIGN" when
aligning the pointer "p". Since "NFCT_ALIGN" always gives the same result
for the same input.

Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_core.c

index 7f8b245e287aebf305e7e797ab70ac207ebaa012..de8d50af9b5b582213fa369e2f6dd240410654b4 100644 (file)
@@ -531,10 +531,8 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net,
 
                p = tmpl;
                tmpl = (struct nf_conn *)NFCT_ALIGN((unsigned long)p);
-               if (tmpl != p) {
-                       tmpl = (struct nf_conn *)NFCT_ALIGN((unsigned long)p);
+               if (tmpl != p)
                        tmpl->proto.tmpl_padto = (char *)tmpl - (char *)p;
-               }
        } else {
                tmpl = kzalloc(sizeof(*tmpl), flags);
                if (!tmpl)