]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath10k: fix NULL deref upon early FW crash
authorMichal Kazior <michal.kazior@tieto.com>
Wed, 16 Oct 2013 13:46:05 +0000 (16:46 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 21 Oct 2013 13:41:18 +0000 (16:41 +0300)
If firmware crashes during FW probing it would try
to perform FW recovery which uses mac80211
workqueue before registering to mac80211.

Using internal workqueue solves the problem.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/pci.c

index 1129994fb10505864c57e1025d95cec8aa009093..2a360cac4ceec1a47c7484f6a4fd18a50b1d6f5d 100644 (file)
@@ -664,7 +664,8 @@ static void ath10k_core_restart(struct work_struct *work)
                ieee80211_restart_hw(ar->hw);
                break;
        case ATH10K_STATE_OFF:
-               /* this can happen if driver is being unloaded */
+               /* this can happen if driver is being unloaded
+                * or if the crash happens during FW probing */
                ath10k_warn("cannot restart a device that hasn't been started\n");
                break;
        case ATH10K_STATE_RESTARTING:
index f8d59c7b90821a69b3401a7ec143bd6d8e0fc367..d09f8a2861ba76543aca185178fd1100de67a9c9 100644 (file)
@@ -777,7 +777,7 @@ static void ath10k_pci_hif_dump_area(struct ath10k *ar)
                           reg_dump_values[i + 2],
                           reg_dump_values[i + 3]);
 
-       ieee80211_queue_work(ar->hw, &ar->restart_work);
+       queue_work(ar->workqueue, &ar->restart_work);
 }
 
 static void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe,