[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1558020189-16843-1-git-send-email-george_davis@mentor.com>
Date: Thu, 16 May 2019 11:23:08 -0400
From: "George G. Davis" <george_davis@...tor.com>
To: "David S. Miller" <davem@...emloft.net>,
"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
CC: "George G. Davis" <george_davis@...tor.com>
Subject: [PATCH] net: sysctl: cleanup net_sysctl_init error exit paths
Unwind net_sysctl_init error exit goto spaghetti code
Suggested-by: Joshua Frkuska <joshua_frkuska@...tor.com>
Signed-off-by: George G. Davis <george_davis@...tor.com>
---
net/sysctl_net.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 9aed6fe1bf1a..7710a2d7f79a 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -104,14 +104,12 @@ __init int net_sysctl_init(void)
if (!net_header)
goto out;
ret = register_pernet_subsys(&sysctl_pernet_ops);
- if (ret)
- goto out1;
-out:
- return ret;
-out1:
+ if (!ret)
+ goto out;
unregister_sysctl_table(net_header);
net_header = NULL;
- goto out;
+out:
+ return ret;
}
struct ctl_table_header *register_net_sysctl(struct net *net,
--
2.7.4
Powered by blists - more mailing lists