]> git.baikalelectronics.ru Git - kernel.git/commitdiff
netfilter: nf_tables: remove assignment with no effect in chain blob builder
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 27 Jan 2022 12:40:38 +0000 (13:40 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 27 Jan 2022 16:50:56 +0000 (17:50 +0100)
cppcheck possible warnings:

>> net/netfilter/nf_tables_api.c:2014:2: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg]
    ptr += offsetof(struct nft_rule_dp, data);
    ^

Reported-by: kernel test robot <yujie.liu@intel.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c

index cf454f8ca2b09ac5f9e53313691e9ca3d0a14392..5fa16990da95177791dfaa9e7bb31c92f3cae096 100644 (file)
@@ -2011,7 +2011,6 @@ static void nft_last_rule(struct nft_rule_blob *blob, const void *ptr)
 
        prule = (struct nft_rule_dp *)ptr;
        prule->is_last = 1;
-       ptr += offsetof(struct nft_rule_dp, data);
        /* blob size does not include the trailer rule */
 }