Skip to content

Commit 4d08b7b

Browse files
tonylujdavem330
authored andcommitted
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: d7cd421 ("net/smc: Introduce TCP ULP support") Signed-off-by: Tony Lu <tonylu@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9995b40 commit 4d08b7b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

net/smc/af_smc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3087,12 +3087,14 @@ static int __init smc_init(void)
30873087
rc = tcp_register_ulp(&smc_ulp_ops);
30883088
if (rc) {
30893089
pr_err("%s: tcp_ulp_register fails with %d\n", __func__, rc);
3090-
goto out_sock;
3090+
goto out_ib;
30913091
}
30923092

30933093
static_branch_enable(&tcp_have_smc);
30943094
return 0;
30953095

3096+
out_ib:
3097+
smc_ib_unregister_client();
30963098
out_sock:
30973099
sock_unregister(PF_SMC);
30983100
out_proto6:

0 commit comments

Comments
 (0)