Commit 2d82a83e authored by huwentao0417's avatar huwentao0417
Browse files

Revert "RDMA/hns: Add mutex_destroy()"

driver inclusion
category: cleanup
bugzilla: https://gitee.com/openeuler/kernel/issues/I9SONH


CVE: NA

----------------------------------------------------------------------

This reverts commit a38a949a.

Signed-off-by: default avatarhuwentao0417 <huwentao19@h-partners.com>
parent 9bb937dc
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -676,5 +676,4 @@ void hns_roce_cleanup_cq_table(struct hns_roce_dev *hr_dev)

	for (i = 0; i < HNS_ROCE_CQ_BANK_NUM; i++)
		ida_destroy(&hr_dev->cq_table.bank[i].ida);
	mutex_destroy(&hr_dev->cq_table.bank_mutex);
}
+0 −2
Original line number Diff line number Diff line
@@ -936,7 +936,6 @@ void hns_roce_cleanup_hem_table(struct hns_roce_dev *hr_dev,

	if (hns_roce_check_whether_mhop(hr_dev, table->type)) {
		hns_roce_cleanup_mhop_hem_table(hr_dev, table);
		mutex_destroy(&table->mutex);
		return;
	}

@@ -951,7 +950,6 @@ void hns_roce_cleanup_hem_table(struct hns_roce_dev *hr_dev,
			hns_roce_free_hem(hr_dev, table->hem[i]);
		}

	mutex_destroy(&table->mutex);
	kfree(table->hem);
}

+1 −5
Original line number Diff line number Diff line
@@ -3063,8 +3063,6 @@ static void free_mr_exit(struct hns_roce_dev *hr_dev)

	free_mr_uninit_cq(hr_dev);
	free_mr_uninit_pd(hr_dev);

	mutex_destroy(&free_mr->mutex);
}

static int free_mr_alloc_res(struct hns_roce_dev *hr_dev)
@@ -3203,10 +3201,8 @@ static int free_mr_init(struct hns_roce_dev *hr_dev)
	mutex_init(&free_mr->mutex);

	ret = free_mr_alloc_res(hr_dev);
	if (ret) {
		mutex_destroy(&free_mr->mutex);
	if (ret)
		return ret;
	}

	ret = free_mr_modify_qp(hr_dev);
	if (ret)
+0 −14
Original line number Diff line number Diff line
@@ -630,9 +630,6 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx,
	hns_roce_dealloc_reset_entry(context);

error_fail_reset_entry:
	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_CQ_RECORD_DB ||
	    hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_QP_RECORD_DB)
		mutex_destroy(&context->page_mutex);
	hns_roce_dealloc_uar_entry(context);

error_fail_uar_entry:
@@ -656,9 +653,6 @@ static void hns_roce_dealloc_ucontext(struct ib_ucontext *ibcontext)
	hns_roce_unregister_uctx_debugfs(context);

	hns_roce_unregister_udca(hr_dev, context);
	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_CQ_RECORD_DB ||
	    hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_QP_RECORD_DB)
		mutex_destroy(&context->page_mutex);

	hns_roce_dealloc_uar_entry(context);
	hns_roce_dealloc_reset_entry(context);
@@ -1312,10 +1306,6 @@ static void hns_roce_teardown_hca(struct hns_roce_dev *hr_dev)

	hns_roce_cleanup_bitmap(hr_dev);
	mutex_destroy(&hr_dev->uctx_list_mutex);

	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_CQ_RECORD_DB ||
	    hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_QP_RECORD_DB)
		mutex_destroy(&hr_dev->pgdir_mutex);
}

/**
@@ -1385,10 +1375,6 @@ static int hns_roce_setup_hca(struct hns_roce_dev *hr_dev)
err_uar_table_free:
	ida_destroy(&hr_dev->uar_ida.ida);
	mutex_destroy(&hr_dev->uctx_list_mutex);
	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_CQ_RECORD_DB ||
	    hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_QP_RECORD_DB)
		mutex_destroy(&hr_dev->pgdir_mutex);

	return ret;
}

+2 −7
Original line number Diff line number Diff line
@@ -1312,7 +1312,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
	ret = set_qp_param(hr_dev, hr_qp, init_attr, udata, &ucmd);
	if (ret) {
		ibdev_err(ibdev, "failed to set QP param, ret = %d.\n", ret);
		goto err_out;
		return ret;
	}

	if (!udata) {
@@ -1320,7 +1320,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
		if (ret) {
			ibdev_err(ibdev, "failed to alloc wrid, ret = %d.\n",
				  ret);
			goto err_out;
			return ret;
		}
	}

@@ -1391,8 +1391,6 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
	free_qpn(hr_dev, hr_qp);
err_qpn:
	free_kernel_wrid(hr_qp);
err_out:
	mutex_destroy(&hr_qp->mutex);
	return ret;
}

@@ -1410,7 +1408,6 @@ void hns_roce_qp_destroy(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
	free_qp_db(hr_dev, hr_qp, udata);

	kfree(hr_qp);
	mutex_destroy(&hr_qp->mutex);
}

static int check_qp_type(struct hns_roce_dev *hr_dev, enum ib_qp_type type,
@@ -1791,7 +1788,5 @@ void hns_roce_cleanup_qp_table(struct hns_roce_dev *hr_dev)

	for (i = 0; i < HNS_ROCE_QP_BANK_NUM; i++)
		ida_destroy(&hr_dev->qp_table.bank[i].ida);
	mutex_destroy(&hr_dev->qp_table.bank_mutex);
	mutex_destroy(&hr_dev->qp_table.scc_mutex);
	kfree(hr_dev->qp_table.idx_table.spare_idx);
}
Loading