ath10k: prevent hif_stop being called twice
authorMichal Kazior <michal.kazior@tieto.com>
Fri, 16 May 2014 14:15:39 +0000 (17:15 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 23 May 2014 08:00:47 +0000 (11:00 +0300)
Recently there was a bug discovered that involved
hif_stop() being called twice that ended up with a
double free_irq() call but it only manifested with
multiple MSI interrupts mapping.

Catch this kind of a problem early in driver
regardless of interrupt mapping.

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

index 7d72b9cfe0bed2b3fbdc2609343d241c1b5ba219..91d6076d7a711857f8194db70b35765478daa1c9 100644 (file)
@@ -1272,6 +1272,9 @@ static void ath10k_pci_hif_stop(struct ath10k *ar)
 
        ath10k_dbg(ATH10K_DBG_BOOT, "boot hif stop\n");
 
+       if (WARN_ON(!ar_pci->started))
+               return;
+
        ret = ath10k_ce_disable_interrupts(ar);
        if (ret)
                ath10k_warn("failed to disable CE interrupts: %d\n", ret);