summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath10k/core.c
diff options
context:
space:
mode:
authorSimon Wunderlich <sw@simonwunderlich.de>2014-08-12 17:12:17 +0200
committerKalle Valo <kvalo@qca.qualcomm.com>2014-08-14 15:42:17 +0300
commit804eef14790f8917f74945f82db8b55903f76af4 (patch)
treeb2da24d87b7590705ad22acad270f9693f2df659 /drivers/net/wireless/ath/ath10k/core.c
parentbeb4be849a92172b4b95185a19db1691e6223f22 (diff)
ath10k: unregister spectral before mac
If spectral is unregistered after mac80211, the relayfs file has already been removed recursively by mac/cfg80211, and spectral tries to remove the file once more, thus leading to double free problems. Better clean up spectral before to avoid that problem. Reported-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/core.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index d3474b43ac47..ba2e87ab19bd 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1043,6 +1043,12 @@ void ath10k_core_unregister(struct ath10k *ar)
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
+ /* Stop spectral before unregistering from mac80211 to remove the
+ * relayfs debugfs file cleanly. Otherwise the parent debugfs tree
+ * would be already be free'd recursively, leading to a double free.
+ */
+ ath10k_spectral_destroy(ar);
+
/* We must unregister from mac80211 before we stop HTC and HIF.
* Otherwise we will fail to submit commands to FW and mac80211 will be
* unhappy about callback failures. */
@@ -1050,8 +1056,6 @@ void ath10k_core_unregister(struct ath10k *ar)
ath10k_core_free_firmware_files(ar);
- ath10k_spectral_destroy(ar);
-
ath10k_debug_destroy(ar);
}
EXPORT_SYMBOL(ath10k_core_unregister);