mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 07:51:28 +00:00
isert: Make sure we decrement CQ QP counters if QP creation fails
Signed-off-by: Yan Burman <yanb@mellanox.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5863 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1011,7 +1011,7 @@ static int isert_conn_qp_create(struct isert_connection *isert_conn)
|
||||
err = rdma_create_qp(cm_id, isert_dev->pd, &qp_attr);
|
||||
if (unlikely(err)) {
|
||||
pr_err("Failed to create qp, err:%d\n", err);
|
||||
goto out;
|
||||
goto fail_create_qp;
|
||||
}
|
||||
isert_conn->qp = cm_id->qp;
|
||||
|
||||
@@ -1020,6 +1020,12 @@ static int isert_conn_qp_create(struct isert_connection *isert_conn)
|
||||
out:
|
||||
TRACE_EXIT_RES(err);
|
||||
return err;
|
||||
|
||||
fail_create_qp:
|
||||
mutex_lock(&dev_list_mutex);
|
||||
isert_dev->cq_qps[cq_idx]--;
|
||||
mutex_unlock(&dev_list_mutex);
|
||||
goto out;
|
||||
}
|
||||
|
||||
static void isert_conn_qp_destroy(struct isert_connection *isert_conn)
|
||||
@@ -1033,6 +1039,7 @@ static struct isert_connection *isert_conn_create(struct rdma_cm_id *cm_id,
|
||||
{
|
||||
struct isert_connection *isert_conn;
|
||||
int err;
|
||||
struct isert_cq *cq;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -1089,6 +1096,10 @@ static struct isert_connection *isert_conn_create(struct rdma_cm_id *cm_id,
|
||||
return isert_conn;
|
||||
|
||||
fail_post_recv:
|
||||
cq = isert_conn->qp->recv_cq->cq_context;
|
||||
mutex_lock(&dev_list_mutex);
|
||||
isert_dev->cq_qps[cq->idx]--;
|
||||
mutex_unlock(&dev_list_mutex);
|
||||
isert_conn_qp_destroy(isert_conn);
|
||||
fail_qp:
|
||||
isert_pdu_free(isert_conn->login_rsp_pdu);
|
||||
|
||||
Reference in New Issue
Block a user