Commit 1005954e authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman

rtlwifi: pci: Fix oops on driver unload

commit 9278db62 upstream.

On Fedora systems, unloading rtl8192ce causes an oops. This patch fixes the
problem reported at https://bugzilla.redhat.com/show_bug.cgi?id=852761.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a86f1d64
...@@ -678,6 +678,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw) ...@@ -678,6 +678,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
}; };
int index = rtlpci->rx_ring[rx_queue_idx].idx; int index = rtlpci->rx_ring[rx_queue_idx].idx;
if (rtlpci->driver_is_goingto_unload)
return;
/*RX NORMAL PKT */ /*RX NORMAL PKT */
while (count--) { while (count--) {
/*rx descriptor */ /*rx descriptor */
...@@ -1553,6 +1555,7 @@ static void rtl_pci_stop(struct ieee80211_hw *hw) ...@@ -1553,6 +1555,7 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
*/ */
set_hal_stop(rtlhal); set_hal_stop(rtlhal);
rtlpci->driver_is_goingto_unload = true;
rtlpriv->cfg->ops->disable_interrupt(hw); rtlpriv->cfg->ops->disable_interrupt(hw);
cancel_work_sync(&rtlpriv->works.lps_leave_work); cancel_work_sync(&rtlpriv->works.lps_leave_work);
...@@ -1570,7 +1573,6 @@ static void rtl_pci_stop(struct ieee80211_hw *hw) ...@@ -1570,7 +1573,6 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
ppsc->rfchange_inprogress = true; ppsc->rfchange_inprogress = true;
spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flags); spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flags);
rtlpci->driver_is_goingto_unload = true;
rtlpriv->cfg->ops->hw_disable(hw); rtlpriv->cfg->ops->hw_disable(hw);
/* some things are not needed if firmware not available */ /* some things are not needed if firmware not available */
if (!rtlpriv->max_fw_size) if (!rtlpriv->max_fw_size)
......
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