summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTony Lu <tonylu@linux.alibaba.com>2022-02-25 14:56:57 +0800
committerDavid S. Miller <davem@davemloft.net>2022-02-28 11:31:49 +0000
commit4d08b7b57ece83a1c31c633a7e4e27f121157f9c (patch)
tree29c695b76dfd29341bc29d5c940059fa7dd51fb7 /net
parent9995b408f17ff8c7f11bc725c8aa225ba3a63b1c (diff)
downloadlinux-4d08b7b57ece83a1c31c633a7e4e27f121157f9c.tar.gz
linux-4d08b7b57ece83a1c31c633a7e4e27f121157f9c.tar.bz2
linux-4d08b7b57ece83a1c31c633a7e4e27f121157f9c.zip
net/smc: Fix cleanup when register ULP fails
This patch calls smc_ib_unregister_client() when tcp_register_ulp() fails, and make sure to clean it up. Fixes: d7cd421da9da ("net/smc: Introduce TCP ULP support") Signed-off-by: Tony Lu <tonylu@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/smc/af_smc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 81984c1c0e78..284befa90967 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -3087,12 +3087,14 @@ static int __init smc_init(void)
rc = tcp_register_ulp(&smc_ulp_ops);
if (rc) {
pr_err("%s: tcp_ulp_register fails with %d\n", __func__, rc);
- goto out_sock;
+ goto out_ib;
}
static_branch_enable(&tcp_have_smc);
return 0;
+out_ib:
+ smc_ib_unregister_client();
out_sock:
sock_unregister(PF_SMC);
out_proto6: