diff options
author | Chaitra P B <chaitra.basappa@broadcom.com> | 2018-04-24 11:28:42 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-05-08 06:40:05 +0200 |
commit | 87b3576e9eaba85644c643bb55b485b5330a2af5 (patch) | |
tree | c0160ec97f874cd5669ae03613de1cc9962b51ac /drivers/scsi/mpt3sas | |
parent | scsi: mpt3sas: For NVME device, issue a protocol level reset (diff) | |
download | linux-87b3576e9eaba85644c643bb55b485b5330a2af5.tar.xz linux-87b3576e9eaba85644c643bb55b485b5330a2af5.zip |
scsi: mpt3sas: fix possible memory leak.
In ioctl exit path driver refers ioc_list to free memory associated with
diag buffers and event_log pointer used to save events by driver.
If ctl_exit() func is called after unregistering driver, then ioc_list will
be empty and hence driver will not be able to free the allocated memory
which in turn causes memory leak.
So call ctl_exit() function before unregistering mpt3sas driver.
Signed-off-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 3dd70de58132..b8d131a455d0 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -11287,10 +11287,10 @@ _mpt3sas_exit(void) pr_info("mpt3sas version %s unloading\n", MPT3SAS_DRIVER_VERSION); - pci_unregister_driver(&mpt3sas_driver); - mpt3sas_ctl_exit(hbas_to_enumerate); + pci_unregister_driver(&mpt3sas_driver); + scsih_exit(); } |