[Devel,1/3] netlink: simplify nfnetlink_bind

Submitted by Igor Redko on Oct. 25, 2016, 1:33 p.m.

Details

Message ID 1477402406-843859-1-git-send-email-redkoi@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Igor Redko Oct. 25, 2016, 1:33 p.m.
From: Richard Guy Briggs <rgb@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@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Igor Redko <redkoi@virtuozzo.com>
---
 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