iwlwifi: unregister LEDs if mac80211 registration fails
authorJohannes Berg <johannes.berg@intel.com>
Tue, 5 Jun 2012 07:38:35 +0000 (09:38 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 19 Jun 2012 22:18:13 +0000 (23:18 +0100)
commit 0e1fa7ef25004b9c1a14147bce61c15c2f1c6744 upstream.

Otherwise the LEDs stick around and cause issues the
next time around since they're still there but not
really hooked up.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/iwlwifi/iwl-agn.c

index 8b88e87..16cdd12 100644 (file)
@@ -1741,6 +1741,7 @@ static int iwlagn_mac_setup_register(struct iwl_priv *priv,
        ret = ieee80211_register_hw(priv->hw);
        if (ret) {
                IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
+               iwl_leds_exit(priv);
                return ret;
        }
        priv->mac80211_registered = 1;