scsi: pmcraid: decrement adapter count on remove
Subsystems (3)
PATCH 1/1 scsi: pmcraid: decrement adapter count on remove
pmcraid_probe() increments pmcraid_adapter_count when an adapter is being initialized. All probe failure paths decrement the count again, but the normal remove path does not perform the corresponding cleanup.
As a result, the adapter count remains incremented after a device is removed. Repeated bind and unbind cycles can eventually make the count reach PMCRAID_MAX_ADAPTERS and prevent otherwise valid adapters from being probed.
Decrement pmcraid_adapter_count in pmcraid_remove(), matching the probe error path.
This issue was found by manual code inspection.
Fixes 89a368104150 ("[SCSI] pmcraid: PMC-Sierra MaxRAID driver to support 6Gb/s SAS RAID controller")
Signed-off-by Guangshuo Li <[email protected]>
--- drivers/scsi/pmcraid.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/pmcraid.c +1 -0
@@ -4778,6 +4778,7 @@ static void pmcraid_remove(struct pci_dev *pdev)iounmap (pinstance->mapped_dma_addr);pci_release_regions (pdev);scsi_host_put (pinstance->host); +atomic_dec (&pmcraid_adapter_count);pci_disable_device (pdev);return ;
Signature · 1 line
2.43.0