greybus: nullify dangling pointers
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 14 Nov 2014 11:55:01 +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/ap.c
drivers/staging/greybus/debugfs.c
drivers/staging/greybus/gbuf.c

index a8cd7e7cdd60eb49cbfe389b5e716837410c0679..9d743f28e08e21e40323123396534fe04826988b 100644 (file)
@@ -367,6 +367,7 @@ int gb_ap_init(void)
 void gb_ap_exit(void)
 {
        destroy_workqueue(ap_workqueue);
+       ap_workqueue = NULL;
 }
 
 
index ef292f43db45cd63c260a110172018ce0a042e7b..4755a36d0522a7c1bdcfeb18e251e53d0a872f22 100644 (file)
@@ -26,4 +26,5 @@ int gb_debugfs_init(void)
 void gb_debugfs_cleanup(void)
 {
        debugfs_remove_recursive(gb_debug_root);
+       gb_debug_root = NULL;
 }
index 8b5a438e3b012867a0f8783ae061da939f09b095..d5cfb38d6d750adf5cae507629c402469a9e279c 100644 (file)
@@ -136,4 +136,5 @@ int gb_gbuf_init(void)
 void gb_gbuf_exit(void)
 {
        kmem_cache_destroy(gbuf_head_cache);
+       gbuf_head_cache = NULL;
 }