net/smc: simplify function smc_clcsock_accept()
authorUrsula Braun <ubraun@linux.vnet.ibm.com>
Wed, 24 Jan 2018 09:28:13 +0000 (10:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jan 2018 15:52:57 +0000 (10:52 -0500)
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>
net/smc/af_smc.c

index eccccf743b9fe47a3862bcdf245bcab3dadd7208..05cbcd3a6f6079149e2f809dc1df7c78c0cbbcbe 100644 (file)
@@ -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;