staging: unisys: visornic: don't destroy global workqueues until devs destroyed
authorTim Sell <Timothy.Sell@unisys.com>
Thu, 9 Jul 2015 17:27:49 +0000 (13:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jul 2015 01:34:59 +0000 (18:34 -0700)
visornic_cleanup() was previously incorrectly destroying its global
workqueues prior to cleaning up the devices which used them.  This patch
corrects the order of these operations.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visornic/visornic_main.c

index ba460539adb6d618945a63580e129baa81d88a31..14977ad356cfb0e52822707bc5cc29182b6356a1 100644 (file)
@@ -2241,6 +2241,8 @@ cleanup_debugfs:
  */
 static void visornic_cleanup(void)
 {
+       visorbus_unregister_visor_driver(&visornic_driver);
+
        if (visornic_serverdown_workqueue) {
                flush_workqueue(visornic_serverdown_workqueue);
                destroy_workqueue(visornic_serverdown_workqueue);
@@ -2251,7 +2253,6 @@ static void visornic_cleanup(void)
        }
        debugfs_remove_recursive(visornic_debugfs_dir);
 
-       visorbus_unregister_visor_driver(&visornic_driver);
        kfree(dev_num_pool);
        dev_num_pool = NULL;
 }