Skip to contentSkip to conversation

mpt3sas: suppress a warning in debug kernel

PATCH Superseded Tomas Henzl 1 participant 2 messages Oct 9, 2023 – Oct 10, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpt3sas: suppress a warning in debug kernel

The mpt3sas_ctl_exit should be called after communication with the controller stops but in the current place it may cause false warnings about memory not released.
Fix it by moving the call right after mpt3sas_base_detach.

---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +1 -2
index c3c1f466fe01..9af7a7e24474 100644
@@ -11350,6 +11350,7 @@ static void scsih_remove(struct pci_dev *pdev)
 	}
 
 	mpt3sas_base_detach(ioc);
+	mpt3sas_ctl_exit(hbas_to_enumerate);
 	spin_lock(&gioc_lock);
 	list_del(&ioc->list);
 	spin_unlock(&gioc_lock);
@@ -12931,8 +12932,6 @@ _mpt3sas_exit(void)
 
 	pci_unregister_driver(&mpt3sas_driver);
 
-	mpt3sas_ctl_exit(hbas_to_enumerate);
-
 	scsih_exit();
 }
 
Signature · 1 line
2.41.0
#1 lore raw

There might be an issue related to this patch, I shall post a modified V2.

Please drop this patch.

Quoted 31 lines · Tomas Henzl

The mpt3sas_ctl_exit should be called after communication with the controller stops but in the current place it may cause false warnings about memory not released.
Fix it by moving the call right after mpt3sas_base_detach.

---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +1 -2
index c3c1f466fe01..9af7a7e24474 100644
@@ -11350,6 +11350,7 @@ static void scsih_remove(struct pci_dev *pdev)
 	}
 
 	mpt3sas_base_detach(ioc);
+	mpt3sas_ctl_exit(hbas_to_enumerate);
 	spin_lock(&gioc_lock);
 	list_del(&ioc->list);
 	spin_unlock(&gioc_lock);
@@ -12931,8 +12932,6 @@ _mpt3sas_exit(void)
 
 	pci_unregister_driver(&mpt3sas_driver);
 
-	mpt3sas_ctl_exit(hbas_to_enumerate);
-
 	scsih_exit();
 }