Commit ce3f7c20 authored by wenglianfa's avatar wenglianfa Committed by Juan Zhou
Browse files

RDMA/hns: Add mutex_destroy() to destroy the mutex

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9GZX2



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

Add mutex_destroy() to destroy the mutex.

Signed-off-by: default avatarwenglianfa <wenglianfa@huawei.com>
Signed-off-by: default avatarJuan Zhou <zhoujuan51@h-partners.com>
parent faf2f459
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -629,6 +629,7 @@ int hns_roce_cleanup_bond(struct hns_roce_bond_group *bond_grp)

	completion_no_waiter = completion_done(&bond_grp->bond_work_done);
	complete(&bond_grp->bond_work_done);
	mutex_destroy(&bond_grp->bond_mutex);
	if (completion_no_waiter)
		kfree(bond_grp);

@@ -780,6 +781,7 @@ static struct hns_roce_bond_group *hns_roce_alloc_bond_grp(struct hns_roce_dev *
	if (ret) {
		ibdev_err(&main_hr_dev->ib_dev,
			  "failed to alloc bond ID, ret = %d.\n", ret);
		mutex_destroy(&bond_grp->bond_mutex);
		kfree(bond_grp);
		return NULL;
	}
+1 −0
Original line number Diff line number Diff line
@@ -1320,6 +1320,7 @@ static int hns_roce_setup_hca(struct hns_roce_dev *hr_dev)
	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);
	mutex_destroy(&hr_dev->uctx_list_mutex);

	return ret;
}