summaryrefslogtreecommitdiff
path: root/net/smc
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-08-01 10:43:15 -0700
committerJakub Kicinski <kuba@kernel.org>2024-08-01 10:45:23 -0700
commit5fa35bd39ce106889909444c937a10b2d3a79f08 (patch)
treebb1fde34b2c9907b1c4b69f6db992bbda0b02355 /net/smc
parent743ff02152bc46bb4a2f2a49ec891c87eba6ab5b (diff)
parent183d46ff422ef9f3d755b6808ef3faa6d009ba3a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. No conflicts or adjacent changes. Link: https://patch.msgid.link/20240801131917.34494-1-pabeni@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/af_smc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 6f82e4d8fda4..0316217b7687 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -3311,10 +3311,8 @@ int smc_create_clcsk(struct net *net, struct sock *sk, int family)
rc = sock_create_kern(net, family, SOCK_STREAM, IPPROTO_TCP,
&smc->clcsock);
- if (rc) {
- sk_common_release(sk);
+ if (rc)
return rc;
- }
/* smc_clcsock_release() does not wait smc->clcsock->sk's
* destruction; its sk_state might not be TCP_CLOSE after
@@ -3360,6 +3358,9 @@ static int __smc_create(struct net *net, struct socket *sock, int protocol,
smc->clcsock = clcsock;
else
rc = smc_create_clcsk(net, sk, family);
+
+ if (rc)
+ sk_common_release(sk);
out:
return rc;
}