Commit 59c209a6 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: qla2xxx: Unregister resources in the opposite order of the registration order

Make sure that resources are only unregistered after the users of these
resources have been unregistered. Only unregister the character device if
registration of it succeeded.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c794d24e
...@@ -7407,14 +7407,15 @@ qla2x00_module_init(void) ...@@ -7407,14 +7407,15 @@ qla2x00_module_init(void)
static void __exit static void __exit
qla2x00_module_exit(void) qla2x00_module_exit(void)
{ {
unregister_chrdev(apidev_major, QLA2XXX_APIDEV);
pci_unregister_driver(&qla2xxx_pci_driver); pci_unregister_driver(&qla2xxx_pci_driver);
qla2x00_release_firmware(); qla2x00_release_firmware();
kmem_cache_destroy(srb_cachep);
qlt_exit();
kmem_cache_destroy(ctx_cachep); kmem_cache_destroy(ctx_cachep);
fc_release_transport(qla2xxx_transport_template);
fc_release_transport(qla2xxx_transport_vport_template); fc_release_transport(qla2xxx_transport_vport_template);
if (apidev_major >= 0)
unregister_chrdev(apidev_major, QLA2XXX_APIDEV);
fc_release_transport(qla2xxx_transport_template);
qlt_exit();
kmem_cache_destroy(srb_cachep);
} }
module_init(qla2x00_module_init); module_init(qla2x00_module_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment