Commit 6dab55bf authored by Dan Carpenter's avatar Dan Carpenter Committed by John W. Linville

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8d6a686a
...@@ -1456,6 +1456,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, ...@@ -1456,6 +1456,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
struct ath_wiphy *aphy = hw->priv; struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc; struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
int ret = 0;
ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
...@@ -1465,7 +1466,8 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, ...@@ -1465,7 +1466,8 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
if (sc->nbcnvifs >= ATH_BCBUF) { if (sc->nbcnvifs >= ATH_BCBUF) {
ath_err(common, "No beacon slot available\n"); ath_err(common, "No beacon slot available\n");
return -ENOBUFS; ret = -ENOBUFS;
goto out;
} }
break; break;
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
...@@ -1479,14 +1481,15 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, ...@@ -1479,14 +1481,15 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
default: default:
ath_err(common, "Interface type %d not yet supported\n", ath_err(common, "Interface type %d not yet supported\n",
vif->type); vif->type);
mutex_unlock(&sc->mutex); ret = -ENOTSUPP;
return -ENOTSUPP; goto out;
} }
vif->type = new_type; vif->type = new_type;
vif->p2p = p2p; vif->p2p = p2p;
out:
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
return 0; return ret;
} }
static void ath9k_remove_interface(struct ieee80211_hw *hw, static void ath9k_remove_interface(struct ieee80211_hw *hw,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment