Skip to contentSkip to conversation

net/smc: Fix cleanup when register ULP fails

PATCH Applied Tony Lu 2 participants 2 messages Feb 25, 2022 – Feb 28, 2022

Subsystems (4)
lore
Share & tools
lore

Tony Lu

author reviewer
#0 lore raw

PATCH 1/1 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")
---
 net/smc/af_smc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
net/smc/af_smc.c +3 -1
index 30acc31b2c45..d1a1343623f6 100644
@@ -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:
Signature · 1 line
2.32.0.3.g01195cf9f
#1 lore raw
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Fri, 25 Feb 2022 14:56:57 +0800 you wrote:

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

Here is the summary with links:
- [net] net/smc: Fix cleanup when register ULP fails

    https://git.kernel.org/netdev/net/c/4d08b7b57ece

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html