diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 0316217b7687388de37e0dfe1e11fe6b4ee6b628..9d76e902fd770f5b10d9cd8ae977f1d80552066f 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -3359,8 +3359,10 @@ static int __smc_create(struct net *net, struct socket *sock, int protocol, else rc = smc_create_clcsk(net, sk, family); - if (rc) + if (rc) { sk_common_release(sk); + sock->sk = NULL; + } out: return rc; }