[PATCH -next] netfilter: nftables: remove unnecessary spin_lock_init()

Subsystems: netfilter, networking [general], the rest

STALE1961d

2 messages, 2 authors, 2021-03-30 · open the first message on its own page

[PATCH -next] netfilter: nftables: remove unnecessary spin_lock_init()

From: Yang Yingliang <hidden>
Date: 2021-03-29 13:53:33

The spinlock nf_tables_destroy_list_lock is initialized statically.
It is unnecessary to initialize by spin_lock_init().

Reported-by: Hulk Robot <redacted>
Signed-off-by: Yang Yingliang <redacted>
---
 net/netfilter/nf_tables_api.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index fc2526b8bd55..24eeb027a888 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -9193,7 +9193,6 @@ static int __init nf_tables_module_init(void)
 {
 	int err;
 
-	spin_lock_init(&nf_tables_destroy_list_lock);
 	err = register_pernet_subsys(&nf_tables_net_ops);
 	if (err < 0)
 		return err;
-- 
2.25.1

Re: [PATCH -next] netfilter: nftables: remove unnecessary spin_lock_init()

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: 2021-03-30 22:55:37

On Mon, Mar 29, 2021 at 09:55:41PM +0800, Yang Yingliang wrote:
The spinlock nf_tables_destroy_list_lock is initialized statically.
It is unnecessary to initialize by spin_lock_init().
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help