From 9ad96da69350712cbba71e946660ede49017b507 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 18 Oct 2011 21:48:54 +0200 Subject: Fix crash on the driver unload --- driver/base.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/driver/base.c b/driver/base.c index 2b998e3..51dd1f4 100644 --- a/driver/base.c +++ b/driver/base.c @@ -259,11 +259,12 @@ init_alloc_fail: */ static void pcidriver_exit(void) { + pci_unregister_driver(&pcidriver_driver); + unregister_chrdev_region(pcidriver_devt, MAXDEVICES); + if (pcidriver_class != NULL) class_destroy(pcidriver_class); - pci_unregister_driver(&pcidriver_driver); - unregister_chrdev_region(pcidriver_devt, MAXDEVICES); mod_info("Module unloaded\n"); } -- cgit v1.2.3