Skip to content

Commit 9278db6

Browse files
lwfingerlinvjw
authored andcommitted
rtlwifi: pci: Fix oops on driver unload
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: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 657eb17 commit 9278db6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/net/wireless/rtlwifi

‎drivers/net/wireless/rtlwifi/pci.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
740740
};
741741
int index = rtlpci->rx_ring[rx_queue_idx].idx;
742742

743+
if (rtlpci->driver_is_goingto_unload)
744+
return;
743745
/*RX NORMAL PKT */
744746
while (count--) {
745747
/*rx descriptor */
@@ -1636,6 +1638,7 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
16361638
*/
16371639
set_hal_stop(rtlhal);
16381640

1641+
rtlpci->driver_is_goingto_unload = true;
16391642
rtlpriv->cfg->ops->disable_interrupt(hw);
16401643
cancel_work_sync(&rtlpriv->works.lps_change_work);
16411644

@@ -1653,7 +1656,6 @@ static void rtl_pci_stop(struct ieee80211_hw *hw)
16531656
ppsc->rfchange_inprogress = true;
16541657
spin_unlock_irqrestore(&rtlpriv->locks.rf_ps_lock, flags);
16551658

1656-
rtlpci->driver_is_goingto_unload = true;
16571659
rtlpriv->cfg->ops->hw_disable(hw);
16581660
/* some things are not needed if firmware not available */
16591661
if (!rtlpriv->max_fw_size)

0 commit comments

Comments
 (0)