diff mbox series

[net-next,2/8] netfilter: nf_tables: Drop pointless memset when dumping rules

Message ID 20231010145343.12551-3-fw@strlen.de
State Handled Elsewhere, archived
Headers show
Series [net-next,1/8] netfilter: nf_tables: Always allocate nft_rule_dump_ctx | expand

Commit Message

Florian Westphal Oct. 10, 2023, 2:53 p.m. UTC
From: Phil Sutter <phil@nwl.cc>

None of the dump callbacks uses netlink_callback::args beyond the first
element, no need to zero the data.

Fixes: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/netfilter/nf_tables_api.c | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index ea30bee41a6e..cd3c7dd15530 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -3465,10 +3465,6 @@  static int __nf_tables_dump_rules(struct sk_buff *skb,
 			goto cont_skip;
 		if (*idx < s_idx)
 			goto cont;
-		if (*idx > s_idx) {
-			memset(&cb->args[1], 0,
-					sizeof(cb->args) - sizeof(cb->args[0]));
-		}
 		if (prule)
 			handle = prule->handle;
 		else