Skip to content

Commit

Permalink
scsi: mpt3sas: Fix in error path
Browse files Browse the repository at this point in the history
[ Upstream commit e40c04a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
thenzl authored and gregkh committed Nov 8, 2023
1 parent 4e000da commit 0eb733b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/scsi/mpt3sas/mpt3sas_scsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -12914,8 +12914,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;
}
Expand Down

0 comments on commit 0eb733b

Please sign in to comment.