iwlwifi3945/4965: fix rate control algo reference leak
authorCyrill Gorcunov <gorcunov@gmail.com>
Thu, 13 Dec 2007 23:52:12 +0000 (15:52 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 17 Dec 2007 22:01:39 +0000 (17:01 -0500)
Fix rate control algo reference leak in case if network device has been
failed to register.  In this case special flag priv->mac80211_registered is
not set and the rate algo reference is not freeing on module unload.  That
leads to OOPs in further ieee80211 rate register/unregister procedure (by
any callee).

It should fix the bug #9470

http://bugzilla.kernel.org/show_bug.cgi?id=9470

[akpm@linux-foundation.org: build fix]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/iwlwifi/iwl4965-base.c

index 4bdf237f6adc90b61283624de3e5dc2b7a167822..1c3ca6ebdc4d472b09d98180e0ecc3c6d19c8e93 100644 (file)
@@ -6171,6 +6171,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
                mutex_lock(&priv->mutex);
 
                if (rc) {
+                       iwl_rate_control_unregister(priv->hw);
                        IWL_ERROR("Failed to register network "
                                  "device (error %d)\n", rc);
                        return;
index 8f85564ec6fa4b7e0eac18476d661b5d74534e71..3b31607a27fc4b34695741d788d128043f3784b7 100644 (file)
@@ -6527,6 +6527,7 @@ static void iwl_alive_start(struct iwl_priv *priv)
                mutex_lock(&priv->mutex);
 
                if (rc) {
+                       iwl_rate_control_unregister(priv->hw);
                        IWL_ERROR("Failed to register network "
                                  "device (error %d)\n", rc);
                        return;