diff options
author | wenglianfa <wenglianfa@huawei.com> | 2024-04-12 12:16:14 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2024-04-16 15:06:47 +0300 |
commit | 9a84848dcee289966e8a2c21223bb0d7bc44f201 (patch) | |
tree | 9ee96c10b9620326b3680461f9fe4c2d54cb058d /drivers/infiniband/hw/hns/hns_roce_hw_v2.c | |
parent | ee045493283403969591087bd405fa280103282a (diff) | |
download | linux-9a84848dcee289966e8a2c21223bb0d7bc44f201.tar.xz |
RDMA/hns: Add mutex_destroy()
Add mutex_destroy().
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20240412091616.370789-9-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_hw_v2.c')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 89d0f5b8be75..5d526b5c4b81 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -2667,6 +2667,8 @@ static void free_mr_exit(struct hns_roce_dev *hr_dev) kfree(free_mr->rsv_pd); free_mr->rsv_pd = NULL; } + + mutex_destroy(&free_mr->mutex); } static int free_mr_alloc_res(struct hns_roce_dev *hr_dev) @@ -2817,8 +2819,10 @@ 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) + if (ret) { + mutex_destroy(&free_mr->mutex); return ret; + } ret = free_mr_modify_qp(hr_dev); if (ret) |