ath10k: Fix un-initialized debug objects.
authorBen Greear <greearb@candelatech.com>
Mon, 4 Nov 2013 17:18:16 +0000 (09:18 -0800)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 8 Nov 2013 09:29:46 +0000 (11:29 +0200)
If the 'ar' registration fails early, the debug
objects were not initialized, and trouble ensued when
the object was later destroyed and the un-initialized
objects were accessed.

Per Kalle's suggestion, move the debug_destroy to the
core_unregister method.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c

index 2a360ca..7d86876 100644 (file)
@@ -738,8 +738,6 @@ EXPORT_SYMBOL(ath10k_core_create);
 
 void ath10k_core_destroy(struct ath10k *ar)
 {
-       ath10k_debug_destroy(ar);
-
        flush_workqueue(ar->workqueue);
        destroy_workqueue(ar->workqueue);
 
@@ -986,6 +984,8 @@ void ath10k_core_unregister(struct ath10k *ar)
        ath10k_mac_unregister(ar);
 
        ath10k_core_free_firmware_files(ar);
+
+       ath10k_debug_destroy(ar);
 }
 EXPORT_SYMBOL(ath10k_core_unregister);