Commit 35a6b178 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

net/smc: simplify function smc_clcsock_accept()

Cleanup to avoid duplicate code in smc_clcsock_accept().
No functional change.
Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3163c507
...@@ -599,16 +599,9 @@ static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc) ...@@ -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); rc = kernel_accept(lsmc->clcsock, &new_clcsock, 0);
lock_sock(lsk); lock_sock(lsk);
if (rc < 0) { if (rc < 0)
lsk->sk_err = -rc; lsk->sk_err = -rc;
new_sk->sk_state = SMC_CLOSED; if (rc < 0 || lsk->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 (new_clcsock) if (new_clcsock)
sock_release(new_clcsock); sock_release(new_clcsock);
new_sk->sk_state = SMC_CLOSED; new_sk->sk_state = SMC_CLOSED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment