greybus: operation: free resources in the reverse order of allocation
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 14 Nov 2014 11:55:00 +0000 (17:25 +0530)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 14 Nov 2014 21:32:27 +0000 (13:32 -0800)
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c

index 7fcd8e4..603697e 100644 (file)
@@ -493,8 +493,8 @@ int gb_operation_init(void)
 
 void gb_operation_exit(void)
 {
-       kmem_cache_destroy(gb_operation_cache);
-       gb_operation_cache = NULL;
        destroy_workqueue(gb_operation_recv_workqueue);
        gb_operation_recv_workqueue = NULL;
+       kmem_cache_destroy(gb_operation_cache);
+       gb_operation_cache = NULL;
 }