diff mbox series

[net] net/smc: Fix cleanup when register ULP fails

Message ID 20220225065656.60828-1-tonylu@linux.alibaba.com (mailing list archive)
State Accepted
Commit 4d08b7b57ece83a1c31c633a7e4e27f121157f9c
Delegated to: Netdev Maintainers
Headers show
Series [net] net/smc: Fix cleanup when register ULP fails | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tony Lu Feb. 25, 2022, 6:56 a.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 28, 2022, 11:40 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

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")
> Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
> ---
>  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!
diff mbox series

Patch

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: