iwlwifi3945/4965: fix rate control algo reference leak

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>

authored by Cyrill Gorcunov and committed by John W. Linville a5acc379 b808ab16

+2
+1
drivers/net/wireless/iwlwifi/iwl3945-base.c
··· 6171 6171 mutex_lock(&priv->mutex); 6172 6172 6173 6173 if (rc) { 6174 + iwl_rate_control_unregister(priv->hw); 6174 6175 IWL_ERROR("Failed to register network " 6175 6176 "device (error %d)\n", rc); 6176 6177 return;
+1
drivers/net/wireless/iwlwifi/iwl4965-base.c
··· 6527 6527 mutex_lock(&priv->mutex); 6528 6528 6529 6529 if (rc) { 6530 + iwl_rate_control_unregister(priv->hw); 6530 6531 IWL_ERROR("Failed to register network " 6531 6532 "device (error %d)\n", rc); 6532 6533 return;