diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-06-26 11:47:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-26 13:10:16 -0400 |
commit | 8c33bf1b0a9663d1742cb19ee71da46a1d8670dd (patch) | |
tree | 6b49ef1319ea4efc0838a85d71b746c3c1ba8e13 | |
parent | 4480879251fb89b1c5585112b1ccc8c3333b41af (diff) |
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>
-rw-r--r-- | net/smc/af_smc.c | 5 |
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) | |||
2029 | 2029 | ||
2030 | rc = smc_pnet_init(); | 2030 | rc = smc_pnet_init(); |
2031 | if (rc) | 2031 | if (rc) |
2032 | return rc; | 2032 | goto out_pernet_subsys; |
2033 | 2033 | ||
2034 | rc = smc_llc_init(); | 2034 | rc = smc_llc_init(); |
2035 | if (rc) { | 2035 | if (rc) { |
@@ -2080,6 +2080,9 @@ out_proto: | |||
2080 | proto_unregister(&smc_proto); | 2080 | proto_unregister(&smc_proto); |
2081 | out_pnet: | 2081 | out_pnet: |
2082 | smc_pnet_exit(); | 2082 | smc_pnet_exit(); |
2083 | out_pernet_subsys: | ||
2084 | unregister_pernet_subsys(&smc_net_ops); | ||
2085 | |||
2083 | return rc; | 2086 | return rc; |
2084 | } | 2087 | } |
2085 | 2088 | ||