aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-06-26 17:47:50 +0200
committerDavid S. Miller <davem@davemloft.net>2019-06-26 10:10:16 -0700
commit8c33bf1b0a9663d1742cb19ee71da46a1d8670dd (patch)
tree6b49ef1319ea4efc0838a85d71b746c3c1ba8e13 /net
parent4480879251fb89b1c5585112b1ccc8c3333b41af (diff)
downloadtip-8c33bf1b0a9663d1742cb19ee71da46a1d8670dd.tar.gz
tip-8c33bf1b0a9663d1742cb19ee71da46a1d8670dd.tar.xz
tip-8c33bf1b0a9663d1742cb19ee71da46a1d8670dd.zip
net/smc: Fix error path in smc_init
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@huawei.com> Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/smc/af_smc.c5
1 files changed, 4 insertions, 1 deletions
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 @@ out_proto:
proto_unregister(&smc_proto);
out_pnet:
smc_pnet_exit();
+out_pernet_subsys:
+ unregister_pernet_subsys(&smc_net_ops);
+
return rc;
}