X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fnet%2Fwireless%2Fath%2Fath9k%2Fmain.c;h=c5cf8639e721ef91facd67cdd85edc9b418b71ef;hb=6dab55bf7eb52ca21d5e6c97b97f70875fe41ddc;hp=0348731accae26b3a481cb45d74369c9075f07b7;hpb=8d6a686a0d20d39c202fdfc6fa7f1daf1d6e3b35;p=mv-sheeva.git diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 0348731acca..c5cf8639e72 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, struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = aphy->sc; struct ath_common *common = ath9k_hw_common(sc->sc_ah); + int ret = 0; ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); mutex_lock(&sc->mutex); @@ -1465,7 +1466,8 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, case NL80211_IFTYPE_ADHOC: if (sc->nbcnvifs >= ATH_BCBUF) { ath_err(common, "No beacon slot available\n"); - return -ENOBUFS; + ret = -ENOBUFS; + goto out; } break; case NL80211_IFTYPE_STATION: @@ -1479,14 +1481,15 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, 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; +out: mutex_unlock(&sc->mutex); - return 0; + return ret; } static void ath9k_remove_interface(struct ieee80211_hw *hw,