浏览代码

ath5k: avoid leaking mutex in ath5k_config

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville 16 年之前
父节点
当前提交
55aa4e0f16
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      drivers/net/wireless/ath/ath5k/base.c

+ 3 - 2
drivers/net/wireless/ath/ath5k/base.c

@@ -2779,7 +2779,7 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
 
 
 	ret = ath5k_chan_set(sc, conf->channel);
 	ret = ath5k_chan_set(sc, conf->channel);
 	if (ret < 0)
 	if (ret < 0)
-		return ret;
+		goto unlock;
 
 
 	if ((changed & IEEE80211_CONF_CHANGE_POWER) &&
 	if ((changed & IEEE80211_CONF_CHANGE_POWER) &&
 	(sc->power_level != conf->power_level)) {
 	(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);
 	ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
 
 
+unlock:
 	mutex_unlock(&sc->lock);
 	mutex_unlock(&sc->lock);
-	return 0;
+	return ret;
 }
 }
 
 
 #define SUPPORTED_FIF_FLAGS \
 #define SUPPORTED_FIF_FLAGS \