Commit d4caa1a4 authored by Tomas Henzl's avatar Tomas Henzl Committed by Martin K. Petersen

scsi: mpi3mr: Fix sas_hba.phy memory leak in mpi3mr_remove()

Free mrioc->sas_hba.phy at .remove.

Fixes: 42fc9fee ("scsi: mpi3mr: Add helper functions to manage device's port")
Signed-off-by: default avatarTomas Henzl <thenzl@redhat.com>
Link: https://lore.kernel.org/r/20230302234336.25456-5-thenzl@redhat.comAcked-by: default avatarSathya Prakash Veerichetty <sathya.prakash@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d0f3c372
......@@ -5128,6 +5128,12 @@ static void mpi3mr_remove(struct pci_dev *pdev)
}
spin_unlock_irqrestore(&mrioc->sas_node_lock, flags);
if (mrioc->sas_hba.num_phys) {
kfree(mrioc->sas_hba.phy);
mrioc->sas_hba.phy = NULL;
mrioc->sas_hba.num_phys = 0;
}
spin_lock(&mrioc_list_lock);
list_del(&mrioc->list);
spin_unlock(&mrioc_list_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment