net/smc: handle all error codes from smc_conn_create()
authorKarsten Graul <kgraul@linux.ibm.com>
Tue, 15 May 2018 15:05:00 +0000 (17:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 15:49:19 +0000 (11:49 -0400)
Always set a reason_code when smc_conn_create() returns an error code.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c

index 397ba2182453f983e9da998f88ebdc6471d36fc1..ecf9ba68501b8e680c9723b289365aae4f37568d 100644 (file)
@@ -463,6 +463,8 @@ static int smc_connect_rdma(struct smc_sock *smc)
                        reason_code = SMC_CLC_DECL_MEM;/* insufficient memory*/
                else if (rc == -ENOLINK)
                        reason_code = SMC_CLC_DECL_SYNCERR; /* synchr. error */
+               else
+                       reason_code = SMC_CLC_DECL_INTERR; /* other error */
                goto decline_rdma_unlock;
        }
        link = &smc->conn.lgr->lnk[SMC_SINGLE_LINK];