mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-27 12:48:12 -04:00
scsi: mpi3mr: Fix sas_hba.phy memory leak in mpi3mr_remove()
Free mrioc->sas_hba.phy at .remove.
Fixes: 42fc9fee11 ("scsi: mpi3mr: Add helper functions to manage device's port")
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Link: https://lore.kernel.org/r/20230302234336.25456-5-thenzl@redhat.com
Acked-by: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
d0f3c3728d
commit
d4caa1a425
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user