]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/irdma: Add missing mutex destroy
authorAnil Samal <anil.samal@intel.com>
Tue, 25 Nov 2025 02:53:46 +0000 (20:53 -0600)
committerLeon Romanovsky <leon@kernel.org>
Wed, 26 Nov 2025 07:26:05 +0000 (02:26 -0500)
Add missing destroy of ah_tbl_lock and vchnl_mutex.

Fixes: d5edd33364a5 ("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>
drivers/infiniband/hw/irdma/icrdma_if.c
drivers/infiniband/hw/irdma/ig3rdma_if.c
drivers/infiniband/hw/irdma/verbs.c

index 5d3fd118e4f819597c0ea1cc3da00133b355607b..b49fd9cf2476544ea24d6e9f821704f6dc80914e 100644 (file)
@@ -302,7 +302,8 @@ err_rt_init:
 err_ctrl_init:
        icrdma_deinit_interrupts(rf, cdev_info);
 err_init_interrupts:
-       kfree(iwdev->rf);
+       mutex_destroy(&rf->ah_tbl_lock);
+       kfree(rf);
        ib_dealloc_device(&iwdev->ibdev);
 
        return err;
@@ -319,6 +320,7 @@ static void icrdma_remove(struct auxiliary_device *aux_dev)
        ice_rdma_update_vsi_filter(cdev_info, iwdev->vsi_num, false);
        irdma_ib_unregister_device(iwdev);
        icrdma_deinit_interrupts(iwdev->rf, cdev_info);
+       mutex_destroy(&iwdev->rf->ah_tbl_lock);
 
        kfree(iwdev->rf);
 
index 1bb42eb298ba691fe37118467dc91667760b4d93..e1d6670d9396ebb421f9ebf3a4f59066eaea2179 100644 (file)
@@ -55,6 +55,7 @@ static int ig3rdma_vchnl_init(struct irdma_pci_f *rf,
        ret = irdma_sc_vchnl_init(&rf->sc_dev, &virt_info);
        if (ret) {
                destroy_workqueue(rf->vchnl_wq);
+               mutex_destroy(&rf->sc_dev.vchnl_mutex);
                return ret;
        }
 
@@ -124,7 +125,9 @@ static void ig3rdma_decfg_rf(struct irdma_pci_f *rf)
 {
        struct irdma_hw *hw = &rf->hw;
 
+       mutex_destroy(&rf->ah_tbl_lock);
        destroy_workqueue(rf->vchnl_wq);
+       mutex_destroy(&rf->sc_dev.vchnl_mutex);
        kfree(hw->io_regs);
        iounmap(hw->rdma_reg.addr);
 }
@@ -149,6 +152,7 @@ static int ig3rdma_cfg_rf(struct irdma_pci_f *rf,
        err = ig3rdma_cfg_regions(&rf->hw, cdev_info);
        if (err) {
                destroy_workqueue(rf->vchnl_wq);
+               mutex_destroy(&rf->sc_dev.vchnl_mutex);
                return err;
        }
 
index 5fb6014ab8cb40f72196c842215f293bf98e4002..1fbc3592e13d27ca3bad869d86ccbd31f793aff2 100644 (file)
@@ -5506,7 +5506,9 @@ void irdma_ib_dealloc_device(struct ib_device *ibdev)
        irdma_rt_deinit_hw(iwdev);
        if (!iwdev->is_vport) {
                irdma_ctrl_deinit_hw(iwdev->rf);
-               if (iwdev->rf->vchnl_wq)
+               if (iwdev->rf->vchnl_wq) {
                        destroy_workqueue(iwdev->rf->vchnl_wq);
+                       mutex_destroy(&iwdev->rf->sc_dev.vchnl_mutex);
+               }
        }
 }