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>
struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
mutex_lock(&sc->mutex);
ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
mutex_lock(&sc->mutex);
case NL80211_IFTYPE_ADHOC:
if (sc->nbcnvifs >= ATH_BCBUF) {
ath_err(common, "No beacon slot available\n");
case NL80211_IFTYPE_ADHOC:
if (sc->nbcnvifs >= ATH_BCBUF) {
ath_err(common, "No beacon slot available\n");
+ ret = -ENOBUFS;
+ goto out;
}
break;
case NL80211_IFTYPE_STATION:
}
break;
case NL80211_IFTYPE_STATION:
default:
ath_err(common, "Interface type %d not yet supported\n",
vif->type);
default:
ath_err(common, "Interface type %d not yet supported\n",
vif->type);
- mutex_unlock(&sc->mutex);
- return -ENOTSUPP;
+ ret = -ENOTSUPP;
+ goto out;
}
vif->type = new_type;
vif->p2p = p2p;
}
vif->type = new_type;
vif->p2p = p2p;
mutex_unlock(&sc->mutex);
mutex_unlock(&sc->mutex);
}
static void ath9k_remove_interface(struct ieee80211_hw *hw,
}
static void ath9k_remove_interface(struct ieee80211_hw *hw,