summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt3sas
diff options
context:
space:
mode:
authorTomas Henzl <thenzl@redhat.com>2023-10-15 13:45:29 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2023-10-17 03:04:54 +0200
commite40c04ade0e2f3916b78211d747317843b11ce10 (patch)
tree76495f6202e1dfd8960181fde48785459c43e041 /drivers/scsi/mpt3sas
parentscsi: ufs: core: Correct clear TM error log (diff)
downloadlinux-e40c04ade0e2f3916b78211d747317843b11ce10.tar.xz
linux-e40c04ade0e2f3916b78211d747317843b11ce10.zip
scsi: mpt3sas: Fix in error path
The driver should be deregistered as misc driver after PCI registration failure. Signed-off-by: Tomas Henzl <thenzl@redhat.com> Link: https://lore.kernel.org/r/20231015114529.10725-1-thenzl@redhat.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpt3sas')
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_scsih.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index c3c1f466fe01..605013d3ee83 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -12913,8 +12913,10 @@ _mpt3sas_init(void)
mpt3sas_ctl_init(hbas_to_enumerate);
error = pci_register_driver(&mpt3sas_driver);
- if (error)
+ if (error) {
+ mpt3sas_ctl_exit(hbas_to_enumerate);
scsih_exit();
+ }
return error;
}