Skip to content

Commit

Permalink
netfilter: nft_set_rbtree: Remove unused variable nft_net
Browse files Browse the repository at this point in the history
The code that uses nft_net has been removed, and the nft_pernet function
is merely obtaining a reference to shared data through the net pointer.
The content of the net pointer is not modified or changed, so both of
them should be removed.

silence the warning:
net/netfilter/nft_set_rbtree.c:627:26: warning: variable ‘nft_net’ set but not used

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7103
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Yang Li authored and Pablo Neira Ayuso committed Nov 14, 2023
1 parent 4b7b492 commit 67059b6
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/netfilter/nft_set_rbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,14 +624,12 @@ static void nft_rbtree_gc(struct nft_set *set)
{
struct nft_rbtree *priv = nft_set_priv(set);
struct nft_rbtree_elem *rbe, *rbe_end = NULL;
struct nftables_pernet *nft_net;
struct rb_node *node, *next;
struct nft_trans_gc *gc;
struct net *net;

set = nft_set_container_of(priv);
net = read_pnet(&set->net);
nft_net = nft_pernet(net);

gc = nft_trans_gc_alloc(set, 0, GFP_KERNEL);
if (!gc)
Expand Down

0 comments on commit 67059b6

Please sign in to comment.