提交 ab77c70a 编写于 作者: S Sujith Manoharan 提交者: John W. Linville

ath9k_htc: Fix error handling in add_interface

Addition of a station might fail - handle this error
properly by removing the VAP on the target.
Also, bail out immediately if the max. no of interfaces
has been reached.
Signed-off-by: NSujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 1057b750
...@@ -1140,7 +1140,8 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw, ...@@ -1140,7 +1140,8 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
if (priv->nvifs >= ATH9K_HTC_MAX_VIF) { if (priv->nvifs >= ATH9K_HTC_MAX_VIF) {
ret = -ENOBUFS; ret = -ENOBUFS;
goto out; mutex_unlock(&priv->mutex);
return ret;
} }
ath9k_htc_ps_wakeup(priv); ath9k_htc_ps_wakeup(priv);
...@@ -1168,18 +1169,19 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw, ...@@ -1168,18 +1169,19 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
if (ret) if (ret)
goto out; goto out;
priv->nvifs++;
/* /*
* We need a node in target to tx mgmt frames * We need a node in target to tx mgmt frames
* before association. * before association.
*/ */
ret = ath9k_htc_add_station(priv, vif, NULL); ret = ath9k_htc_add_station(priv, vif, NULL);
if (ret) if (ret) {
WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif);
goto out; goto out;
}
priv->ah->opmode = vif->type; priv->ah->opmode = vif->type;
priv->vif_slot |= (1 << avp->index); priv->vif_slot |= (1 << avp->index);
priv->nvifs++;
priv->vif = vif; priv->vif = vif;
ath_dbg(common, ATH_DBG_CONFIG, ath_dbg(common, ATH_DBG_CONFIG,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册