Commit 35bd787b authored by Anil Samal's avatar Anil Samal Committed by Leon Romanovsky
Browse files

RDMA/irdma: Add missing mutex destroy



Add missing destroy of ah_tbl_lock and vchnl_mutex.

Fixes: d5edd333 ("RDMA/irdma: RDMA/irdma: Add GEN3 core driver support")
Signed-off-by: default avatarAnil Samal <anil.samal@intel.com>
Signed-off-by: default avatarKrzysztof Czurylo <krzysztof.czurylo@intel.com>
Signed-off-by: default avatarTatyana Nikolova <tatyana.e.nikolova@intel.com>
Link: https://patch.msgid.link/20251125025350.180-6-tatyana.e.nikolova@intel.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 5eff1ecc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -302,7 +302,8 @@ static int icrdma_probe(struct auxiliary_device *aux_dev, const struct auxiliary
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);

+4 −0
Original line number Diff line number Diff line
@@ -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;
	}

+3 −1
Original line number Diff line number Diff line
@@ -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);
		}
	}
}