All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net/smc: Fix cleanup when register ULP fails
@ 2022-02-25  6:56 Tony Lu
  2022-02-28 11:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Lu @ 2022-02-25  6:56 UTC (permalink / raw)
  To: kgraul, kuba, davem; +Cc: netdev, linux-s390

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>
---
 net/smc/af_smc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 30acc31b2c45..d1a1343623f6 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -3270,12 +3270,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:
-- 
2.32.0.3.g01195cf9f


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-28 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-25  6:56 [PATCH net] net/smc: Fix cleanup when register ULP fails Tony Lu
2022-02-28 11:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.