[Devel] [PATCH 1/3] netlink: simplify nfnetlink_bind

Igor Redko redkoi at virtuozzo.com
Tue Oct 25 06:33:24 PDT 2016


From: Richard Guy Briggs <rgb at redhat.com>

upstream: bfe4bc71c64a34813a7bde0ad4d28486679ac3fe

Remove duplicity and simplify code flow by moving the rcu_read_unlock() above
the condition and let the flow control exit naturally at the end of the
function.

Signed-off-by: Richard Guy Briggs <rgb at redhat.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Igor Redko <redkoi at virtuozzo.com>
---
 net/netfilter/nfnetlink.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index e009087..48cf7a1 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -406,12 +406,9 @@ static void nfnetlink_bind(int group)
 
 	rcu_read_lock();
 	ss = nfnetlink_get_subsys(type);
-	if (!ss) {
-		rcu_read_unlock();
-		request_module("nfnetlink-subsys-%d", type);
-		return;
-	}
 	rcu_read_unlock();
+	if (!ss)
+		request_module("nfnetlink-subsys-%d", type);
 }
 #endif
 
-- 
1.8.3.1



More information about the Devel mailing list