Skip to contentSkip to conversation

netfilter: bridge: remove unneeded rcu_read_lock

PATCH Applied Florian Westphal 2 participants 2 messages Mar 7, 2017 – Mar 8, 2017

Subsystems (3)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: bridge: remove unneeded rcu_read_lock

as comment says, the function is always called with rcu read lock held.

---
 net/bridge/br_netfilter_hooks.c | 3 ---
 1 file changed, 3 deletions(-)
net/bridge/br_netfilter_hooks.c +0 -3
index 95087e6..52739e6 100644
@@ -1016,13 +1016,10 @@ int br_nf_hook_thresh(unsigned int hook, struct net *net,
 	if (!elem)
 		return okfn(net, sk, skb);
 
-	/* We may already have this, but read-locks nest anyway */
-	rcu_read_lock();
 	nf_hook_state_init(&state, hook, NFPROTO_BRIDGE, indev, outdev,
 			   sk, net, okfn);
 
 	ret = nf_hook_slow(skb, &state, elem);
-	rcu_read_unlock();
 	if (ret == 1)
 		ret = okfn(net, sk, skb);
 
Signature · 1 line
2.9.3
maintainer Applied
#1 lore raw
Quoted 1 line · Florian Westphal

as comment says, the function is always called with rcu read lock held.

Applied, thanks Florian.