diff --git a/providers/hns/hns_roce_u_db.c b/providers/hns/hns_roce_u_db.c index 0314254f1..bbef98858 100644 --- a/providers/hns/hns_roce_u_db.c +++ b/providers/hns/hns_roce_u_db.c @@ -116,6 +116,8 @@ void *hns_roce_alloc_db(struct hns_roce_context *ctx, out: pthread_mutex_unlock((pthread_mutex_t *)&ctx->db_list_mutex); + if (db) + *((unsigned int *)db) = 0; return db; } diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c index 4b1c73bfe..c0f23a5a5 100644 --- a/providers/hns/hns_roce_u_verbs.c +++ b/providers/hns/hns_roce_u_verbs.c @@ -371,8 +371,6 @@ static struct ibv_cq_ex *create_cq(struct ibv_context *context, goto err_db; } - *cq->db = 0; - ret = exec_cq_create_cmd(context, cq, attr); if (ret) goto err_cmd; @@ -685,8 +683,6 @@ static struct ibv_srq *create_srq(struct ibv_context *context, if (!srq->rdb) goto err_srq_buf; - *srq->rdb = 0; - ret = exec_srq_create_cmd(context, srq, init_attr); if (ret) goto err_srq_db; @@ -1175,8 +1171,6 @@ static int qp_alloc_db(struct ibv_qp_init_attr_ex *attr, struct hns_roce_qp *qp, qp->sdb = hns_roce_alloc_db(ctx, HNS_ROCE_QP_TYPE_DB); if (!qp->sdb) return -ENOMEM; - - *qp->sdb = 0; } if (attr->cap.max_recv_sge) { @@ -1188,8 +1182,6 @@ static int qp_alloc_db(struct ibv_qp_init_attr_ex *attr, struct hns_roce_qp *qp, return -ENOMEM; } - - *qp->rdb = 0; } return 0;