diff mbox series

mpt3sas: fix in error path

Message ID 20231015114529.10725-1-thenzl@redhat.com (mailing list archive)
State Accepted
Headers show
Series mpt3sas: fix in error path | expand

Commit Message

Tomas Henzl Oct. 15, 2023, 11:45 a.m. UTC
The driver should be deregistered as misc driver.

Signed-off-by: Tomas Henzl <thenzl@redhat.com>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Martin K. Petersen Oct. 17, 2023, 1:12 a.m. UTC | #1
Tomas,

> The driver should be deregistered as misc driver.

Applied to 6.6/scsi-fixes, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 9af7a7e24474..107e608e2c41 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -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;
 }