Commit 804eef14 authored by Simon Wunderlich's avatar Simon Wunderlich Committed by Kalle Valo

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: default avatarKalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent beb4be84
...@@ -1043,6 +1043,12 @@ void ath10k_core_unregister(struct ath10k *ar) ...@@ -1043,6 +1043,12 @@ void ath10k_core_unregister(struct ath10k *ar)
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return; 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. /* We must unregister from mac80211 before we stop HTC and HIF.
* Otherwise we will fail to submit commands to FW and mac80211 will be * Otherwise we will fail to submit commands to FW and mac80211 will be
* unhappy about callback failures. */ * unhappy about callback failures. */
...@@ -1050,8 +1056,6 @@ void ath10k_core_unregister(struct ath10k *ar) ...@@ -1050,8 +1056,6 @@ void ath10k_core_unregister(struct ath10k *ar)
ath10k_core_free_firmware_files(ar); ath10k_core_free_firmware_files(ar);
ath10k_spectral_destroy(ar);
ath10k_debug_destroy(ar); ath10k_debug_destroy(ar);
} }
EXPORT_SYMBOL(ath10k_core_unregister); EXPORT_SYMBOL(ath10k_core_unregister);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment