wcn36xx: Don't use the destroyed hal_mutex

ieee80211_unregister_hw() might invoke operations to stop the interface,
that uses the hal_mutex. So don't destroy it until after we're done
using it.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
Bjorn Andersson 2017-01-11 16:32:21 +02:00 committed by Kalle Valo
parent 43efa3c0f2
commit d536288822
1 changed files with 2 additions and 1 deletions

View File

@ -1241,7 +1241,6 @@ static int wcn36xx_remove(struct platform_device *pdev)
wcn36xx_dbg(WCN36XX_DBG_MAC, "platform remove\n"); wcn36xx_dbg(WCN36XX_DBG_MAC, "platform remove\n");
release_firmware(wcn->nv); release_firmware(wcn->nv);
mutex_destroy(&wcn->hal_mutex);
ieee80211_unregister_hw(hw); ieee80211_unregister_hw(hw);
@ -1250,6 +1249,8 @@ static int wcn36xx_remove(struct platform_device *pdev)
iounmap(wcn->dxe_base); iounmap(wcn->dxe_base);
iounmap(wcn->ccu_base); iounmap(wcn->ccu_base);
mutex_destroy(&wcn->hal_mutex);
ieee80211_free_hw(hw); ieee80211_free_hw(hw);
return 0; return 0;