Commit d9a5b486 authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Leon Romanovsky
parent 788bbf4c
...@@ -367,6 +367,15 @@ static void siw_free_cm_id(struct siw_cep *cep) ...@@ -367,6 +367,15 @@ static void siw_free_cm_id(struct siw_cep *cep)
cep->cm_id = NULL; cep->cm_id = NULL;
} }
static void siw_destroy_cep_sock(struct siw_cep *cep)
{
if (cep->sock) {
siw_socket_disassoc(cep->sock);
sock_release(cep->sock);
cep->sock = NULL;
}
}
/* /*
* siw_qp_cm_drop() * siw_qp_cm_drop()
* *
...@@ -423,14 +432,7 @@ void siw_qp_cm_drop(struct siw_qp *qp, int schedule) ...@@ -423,14 +432,7 @@ void siw_qp_cm_drop(struct siw_qp *qp, int schedule)
} }
cep->state = SIW_EPSTATE_CLOSED; cep->state = SIW_EPSTATE_CLOSED;
if (cep->sock) { siw_destroy_cep_sock(cep);
siw_socket_disassoc(cep->sock);
/*
* Immediately close socket
*/
sock_release(cep->sock);
cep->sock = NULL;
}
if (cep->qp) { if (cep->qp) {
cep->qp = NULL; cep->qp = NULL;
siw_qp_put(qp); siw_qp_put(qp);
...@@ -1693,9 +1695,7 @@ int siw_accept(struct iw_cm_id *id, struct iw_cm_conn_param *params) ...@@ -1693,9 +1695,7 @@ int siw_accept(struct iw_cm_id *id, struct iw_cm_conn_param *params)
error_unlock: error_unlock:
up_write(&qp->state_lock); up_write(&qp->state_lock);
error: error:
siw_socket_disassoc(cep->sock); siw_destroy_cep_sock(cep);
sock_release(cep->sock);
cep->sock = NULL;
cep->state = SIW_EPSTATE_CLOSED; cep->state = SIW_EPSTATE_CLOSED;
...@@ -1740,9 +1740,7 @@ int siw_reject(struct iw_cm_id *id, const void *pdata, u8 pd_len) ...@@ -1740,9 +1740,7 @@ int siw_reject(struct iw_cm_id *id, const void *pdata, u8 pd_len)
cep->mpa.hdr.params.bits |= MPA_RR_FLAG_REJECT; /* reject */ cep->mpa.hdr.params.bits |= MPA_RR_FLAG_REJECT; /* reject */
siw_send_mpareqrep(cep, pdata, pd_len); siw_send_mpareqrep(cep, pdata, pd_len);
} }
siw_socket_disassoc(cep->sock); siw_destroy_cep_sock(cep);
sock_release(cep->sock);
cep->sock = NULL;
cep->state = SIW_EPSTATE_CLOSED; cep->state = SIW_EPSTATE_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