]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
ath5k: avoid leaking mutex in ath5k_config
authorJohn W. Linville <linville@tuxdriver.com>
Mon, 25 May 2009 19:28:47 +0000 (21:28 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 3 Jun 2009 18:05:08 +0000 (14:05 -0400)
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/base.c

index fb5193764afa5af3aab8507e0f775528b8649eff..dd6dc8dc740b95f00ce07c360612a1142a83c8d8 100644 (file)
@@ -2779,7 +2779,7 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
 
        ret = ath5k_chan_set(sc, conf->channel);
        if (ret < 0)
-               return ret;
+               goto unlock;
 
        if ((changed & IEEE80211_CONF_CHANGE_POWER) &&
        (sc->power_level != conf->power_level)) {
@@ -2808,8 +2808,9 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
         */
        ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
 
+unlock:
        mutex_unlock(&sc->lock);
-       return 0;
+       return ret;
 }
 
 #define SUPPORTED_FIF_FLAGS \