[Devel,RHEL7,COMMIT] ms/netlink: simplify nfnetlink_bind

Submitted by Konstantin Khorenko on Nov. 30, 2016, 11:41 a.m.

Details

Message ID 201611301141.uAUBf3pd009835@finist_cl7.x64_64.work.ct
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Nov. 30, 2016, 11:41 a.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.7
------>
commit d28ebb190f5565de43e388a4addb2a8c0478817f
Author: Richard Guy Briggs <rgb@redhat.com>
Date:   Wed Nov 30 15:41:03 2016 +0400

    ms/netlink: simplify nfnetlink_bind
    
    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@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    
    This is done in the scope of
    https://jira.sw.ru/browse/PSBM-54189
    
    upstream commit: bfe4bc71c64a34813a7bde0ad4d28486679ac3fe
    
    Signed-off-by: Igor Redko <redkoi@virtuozzo.com>
    Acked-by: Andrei Vagin <avagin@openvz.org>
---
 net/netfilter/nfnetlink.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

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