diff options
author | Dan Carpenter <error27@gmail.com> | 2010-12-20 22:59:06 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-22 15:43:27 -0500 |
commit | 6dab55bf7eb52ca21d5e6c97b97f70875fe41ddc (patch) | |
tree | 78fe102bd2c9eb939a3ba6a13288e21fae263cd6 /drivers/net/wireless/ath/ath9k/main.c | |
parent | 8d6a686a0d20d39c202fdfc6fa7f1daf1d6e3b35 (diff) |
ath9k: unlock on error path in ath9k_change_interface()
There is a missing unlock when we hit the "No beacon slot available"
error condition.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 0348731accae..c5cf8639e721 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1456,6 +1456,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, | |||
1456 | struct ath_wiphy *aphy = hw->priv; | 1456 | struct ath_wiphy *aphy = hw->priv; |
1457 | struct ath_softc *sc = aphy->sc; | 1457 | struct ath_softc *sc = aphy->sc; |
1458 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1458 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
1459 | int ret = 0; | ||
1459 | 1460 | ||
1460 | ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); | 1461 | ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); |
1461 | mutex_lock(&sc->mutex); | 1462 | mutex_lock(&sc->mutex); |
@@ -1465,7 +1466,8 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, | |||
1465 | case NL80211_IFTYPE_ADHOC: | 1466 | case NL80211_IFTYPE_ADHOC: |
1466 | if (sc->nbcnvifs >= ATH_BCBUF) { | 1467 | if (sc->nbcnvifs >= ATH_BCBUF) { |
1467 | ath_err(common, "No beacon slot available\n"); | 1468 | ath_err(common, "No beacon slot available\n"); |
1468 | return -ENOBUFS; | 1469 | ret = -ENOBUFS; |
1470 | goto out; | ||
1469 | } | 1471 | } |
1470 | break; | 1472 | break; |
1471 | case NL80211_IFTYPE_STATION: | 1473 | case NL80211_IFTYPE_STATION: |
@@ -1479,14 +1481,15 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, | |||
1479 | default: | 1481 | default: |
1480 | ath_err(common, "Interface type %d not yet supported\n", | 1482 | ath_err(common, "Interface type %d not yet supported\n", |
1481 | vif->type); | 1483 | vif->type); |
1482 | mutex_unlock(&sc->mutex); | 1484 | ret = -ENOTSUPP; |
1483 | return -ENOTSUPP; | 1485 | goto out; |
1484 | } | 1486 | } |
1485 | vif->type = new_type; | 1487 | vif->type = new_type; |
1486 | vif->p2p = p2p; | 1488 | vif->p2p = p2p; |
1487 | 1489 | ||
1490 | out: | ||
1488 | mutex_unlock(&sc->mutex); | 1491 | mutex_unlock(&sc->mutex); |
1489 | return 0; | 1492 | return ret; |
1490 | } | 1493 | } |
1491 | 1494 | ||
1492 | static void ath9k_remove_interface(struct ieee80211_hw *hw, | 1495 | static void ath9k_remove_interface(struct ieee80211_hw *hw, |