From: Ron Rindjunsky Date: Fri, 28 Mar 2008 23:21:10 +0000 (-0700) Subject: iwlwifi: unregister to upper stack before releasing resources X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c4f552321fa2cfe1d6b1846138d2aa8254308f96;p=linux-beck.git iwlwifi: unregister to upper stack before releasing resources This patch fixes an early release of driver's resources before upper stack was notified that low-level driver shuts down. Signed-off-by: Ron Rindjunsky Signed-off-by: Tomas Winkler Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index ae4e53f5bedd..e98695f7f14c 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c @@ -8207,6 +8207,11 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n"); + if (priv->mac80211_registered) { + ieee80211_unregister_hw(priv->hw); + priv->mac80211_registered = 0; + } + set_bit(STATUS_EXIT_PENDING, &priv->status); iwl4965_down(priv); @@ -8241,9 +8246,6 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) iwl4965_unset_hw_setting(priv); iwlcore_clear_stations_table(priv); - if (priv->mac80211_registered) { - ieee80211_unregister_hw(priv->hw); - } /*netif_stop_queue(dev); */ flush_workqueue(priv->workqueue);