[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190626154750.46127-3-ubraun@linux.ibm.com>
Date: Wed, 26 Jun 2019 17:47:50 +0200
From: Ursula Braun <ubraun@...ux.ibm.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, linux-s390@...r.kernel.org,
gor@...ux.ibm.com, heiko.carstens@...ibm.com, raspl@...ux.ibm.com,
kgraul@...ux.ibm.com, ubraun@...ux.ibm.com, zhp@...il.nju.edu.cn,
yuehaibing@...wei.com
Subject: [PATCH net 2/2] net/smc: Fix error path in smc_init
From: YueHaibing <yuehaibing@...wei.com>
If register_pernet_subsys success in smc_init,
we should cleanup it in case any other error.
Fixes: 64e28b52c7a6 (net/smc: add pnet table namespace support")
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
Signed-off-by: Ursula Braun <ubraun@...ux.ibm.com>
---
net/smc/af_smc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 0c874e996f85..7621ec2f539c 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -2029,7 +2029,7 @@ static int __init smc_init(void)
rc = smc_pnet_init();
if (rc)
- return rc;
+ goto out_pernet_subsys;
rc = smc_llc_init();
if (rc) {
@@ -2080,6 +2080,9 @@ static int __init smc_init(void)
proto_unregister(&smc_proto);
out_pnet:
smc_pnet_exit();
+out_pernet_subsys:
+ unregister_pernet_subsys(&smc_net_ops);
+
return rc;
}
--
2.17.1
Powered by blists - more mailing lists