From: Viresh Kumar <viresh.kumar@linaro.org>
Date: Fri, 14 Nov 2014 11:55:00 +0000 (+0530)
Subject: greybus: operation: free resources in the reverse order of allocation
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=837b3b7c04c1df9dbf5e8dc4b15aaa28e7b6439b;p=linux.git

greybus: operation: free resources in the reverse order of allocation

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
---

diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index 7fcd8e4285eac..603697e5c1169 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -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;
 }