diff options
author | Ursula Braun <ubraun@linux.vnet.ibm.com> | 2018-01-24 12:28:13 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-24 18:52:57 +0300 |
commit | 35a6b17847175c4a6bdb0a16c1692627ca56b7f1 (patch) | |
tree | c4001ff18e11bed2cd996451258b70f1e778a2f9 /net/smc | |
parent | 3163c5071f25e36567608cde0df21b198ee5fbeb (diff) | |
download | linux-35a6b17847175c4a6bdb0a16c1692627ca56b7f1.tar.xz |
net/smc: simplify function smc_clcsock_accept()
Cleanup to avoid duplicate code in smc_clcsock_accept().
No functional change.
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc')
-rw-r--r-- | net/smc/af_smc.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index eccccf743b9f..05cbcd3a6f60 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -599,16 +599,9 @@ static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc) rc = kernel_accept(lsmc->clcsock, &new_clcsock, 0); lock_sock(lsk); - if (rc < 0) { + if (rc < 0) lsk->sk_err = -rc; - new_sk->sk_state = SMC_CLOSED; - sock_set_flag(new_sk, SOCK_DEAD); - new_sk->sk_prot->unhash(new_sk); - sock_put(new_sk); - *new_smc = NULL; - goto out; - } - if (lsk->sk_state == SMC_CLOSED) { + if (rc < 0 || lsk->sk_state == SMC_CLOSED) { if (new_clcsock) sock_release(new_clcsock); new_sk->sk_state = SMC_CLOSED; |