mwl8k: do not free unrequested irq

When the mwl8k driver attempts and fails to switch from sta to ap
firmware (or vice-versa) in the mwl8k_add_interface routine, the
mwl8k_stop routine will be called. This routine must not attempt
to free the irq if it was not requested.

Signed-off-by: Brian Cavagnolo <brian@cozybit.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by Brian Cavagnolo and committed by John W. Linville bf3ca7f7 2845fd85

+8 -1
+8 -1
drivers/net/wireless/mwl8k.c
··· 137 struct mwl8k_priv { 138 struct ieee80211_hw *hw; 139 struct pci_dev *pdev; 140 141 struct mwl8k_device_info *device_info; 142 ··· 3762 rc = request_irq(priv->pdev->irq, mwl8k_interrupt, 3763 IRQF_SHARED, MWL8K_NAME, hw); 3764 if (rc) { 3765 wiphy_err(hw->wiphy, "failed to register IRQ handler\n"); 3766 return -EIO; 3767 } 3768 3769 /* Enable TX reclaim and RX tasklets. */ 3770 tasklet_enable(&priv->poll_tx_task); ··· 3803 if (rc) { 3804 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); 3805 free_irq(priv->pdev->irq, hw); 3806 tasklet_disable(&priv->poll_tx_task); 3807 tasklet_disable(&priv->poll_rx_task); 3808 } ··· 3822 3823 /* Disable interrupts */ 3824 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); 3825 - free_irq(priv->pdev->irq, hw); 3826 3827 /* Stop finalize join worker */ 3828 cancel_work_sync(&priv->finalize_join_worker);
··· 137 struct mwl8k_priv { 138 struct ieee80211_hw *hw; 139 struct pci_dev *pdev; 140 + int irq; 141 142 struct mwl8k_device_info *device_info; 143 ··· 3761 rc = request_irq(priv->pdev->irq, mwl8k_interrupt, 3762 IRQF_SHARED, MWL8K_NAME, hw); 3763 if (rc) { 3764 + priv->irq = -1; 3765 wiphy_err(hw->wiphy, "failed to register IRQ handler\n"); 3766 return -EIO; 3767 } 3768 + priv->irq = priv->pdev->irq; 3769 3770 /* Enable TX reclaim and RX tasklets. */ 3771 tasklet_enable(&priv->poll_tx_task); ··· 3800 if (rc) { 3801 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); 3802 free_irq(priv->pdev->irq, hw); 3803 + priv->irq = -1; 3804 tasklet_disable(&priv->poll_tx_task); 3805 tasklet_disable(&priv->poll_rx_task); 3806 } ··· 3818 3819 /* Disable interrupts */ 3820 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); 3821 + if (priv->irq != -1) { 3822 + free_irq(priv->pdev->irq, hw); 3823 + priv->irq = -1; 3824 + } 3825 3826 /* Stop finalize join worker */ 3827 cancel_work_sync(&priv->finalize_join_worker);