Skip to content

Commit 35bd787

Browse files
ansamalintelrleon
authored andcommitted
RDMA/irdma: Add missing mutex destroy
Add missing destroy of ah_tbl_lock and vchnl_mutex. Fixes: d5edd33 ("RDMA/irdma: RDMA/irdma: Add GEN3 core driver support") Signed-off-by: Anil Samal <anil.samal@intel.com> Signed-off-by: Krzysztof Czurylo <krzysztof.czurylo@intel.com> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Link: https://patch.msgid.link/20251125025350.180-6-tatyana.e.nikolova@intel.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent 5eff1ec commit 35bd787

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

drivers/infiniband/hw/irdma/icrdma_if.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ static int icrdma_probe(struct auxiliary_device *aux_dev, const struct auxiliary
302302
err_ctrl_init:
303303
icrdma_deinit_interrupts(rf, cdev_info);
304304
err_init_interrupts:
305-
kfree(iwdev->rf);
305+
mutex_destroy(&rf->ah_tbl_lock);
306+
kfree(rf);
306307
ib_dealloc_device(&iwdev->ibdev);
307308

308309
return err;
@@ -319,6 +320,7 @@ static void icrdma_remove(struct auxiliary_device *aux_dev)
319320
ice_rdma_update_vsi_filter(cdev_info, iwdev->vsi_num, false);
320321
irdma_ib_unregister_device(iwdev);
321322
icrdma_deinit_interrupts(iwdev->rf, cdev_info);
323+
mutex_destroy(&iwdev->rf->ah_tbl_lock);
322324

323325
kfree(iwdev->rf);
324326

drivers/infiniband/hw/irdma/ig3rdma_if.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static int ig3rdma_vchnl_init(struct irdma_pci_f *rf,
5555
ret = irdma_sc_vchnl_init(&rf->sc_dev, &virt_info);
5656
if (ret) {
5757
destroy_workqueue(rf->vchnl_wq);
58+
mutex_destroy(&rf->sc_dev.vchnl_mutex);
5859
return ret;
5960
}
6061

@@ -124,7 +125,9 @@ static void ig3rdma_decfg_rf(struct irdma_pci_f *rf)
124125
{
125126
struct irdma_hw *hw = &rf->hw;
126127

128+
mutex_destroy(&rf->ah_tbl_lock);
127129
destroy_workqueue(rf->vchnl_wq);
130+
mutex_destroy(&rf->sc_dev.vchnl_mutex);
128131
kfree(hw->io_regs);
129132
iounmap(hw->rdma_reg.addr);
130133
}
@@ -149,6 +152,7 @@ static int ig3rdma_cfg_rf(struct irdma_pci_f *rf,
149152
err = ig3rdma_cfg_regions(&rf->hw, cdev_info);
150153
if (err) {
151154
destroy_workqueue(rf->vchnl_wq);
155+
mutex_destroy(&rf->sc_dev.vchnl_mutex);
152156
return err;
153157
}
154158

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5506,7 +5506,9 @@ void irdma_ib_dealloc_device(struct ib_device *ibdev)
55065506
irdma_rt_deinit_hw(iwdev);
55075507
if (!iwdev->is_vport) {
55085508
irdma_ctrl_deinit_hw(iwdev->rf);
5509-
if (iwdev->rf->vchnl_wq)
5509+
if (iwdev->rf->vchnl_wq) {
55105510
destroy_workqueue(iwdev->rf->vchnl_wq);
5511+
mutex_destroy(&iwdev->rf->sc_dev.vchnl_mutex);
5512+
}
55115513
}
55125514
}

0 commit comments

Comments
 (0)