aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-02-20 21:18:16 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-23 16:25:26 -0500
commitab77c70a15cdff106704a34254341c9a3a11dbc4 (patch)
treeaeb94d7c9e9b5c92a57f5b1817f4bcd349b2fc40 /drivers/net
parent1057b7503908e351b399caeeca38f9ef5fcc766c (diff)
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: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 4ced5cd6ef1c..ebc5dbfb6a1b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1140,7 +1140,8 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
1140 1140
1141 if (priv->nvifs >= ATH9K_HTC_MAX_VIF) { 1141 if (priv->nvifs >= ATH9K_HTC_MAX_VIF) {
1142 ret = -ENOBUFS; 1142 ret = -ENOBUFS;
1143 goto out; 1143 mutex_unlock(&priv->mutex);
1144 return ret;
1144 } 1145 }
1145 1146
1146 ath9k_htc_ps_wakeup(priv); 1147 ath9k_htc_ps_wakeup(priv);
@@ -1168,18 +1169,19 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
1168 if (ret) 1169 if (ret)
1169 goto out; 1170 goto out;
1170 1171
1171 priv->nvifs++;
1172
1173 /* 1172 /*
1174 * We need a node in target to tx mgmt frames 1173 * We need a node in target to tx mgmt frames
1175 * before association. 1174 * before association.
1176 */ 1175 */
1177 ret = ath9k_htc_add_station(priv, vif, NULL); 1176 ret = ath9k_htc_add_station(priv, vif, NULL);
1178 if (ret) 1177 if (ret) {
1178 WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif);
1179 goto out; 1179 goto out;
1180 }
1180 1181
1181 priv->ah->opmode = vif->type; 1182 priv->ah->opmode = vif->type;
1182 priv->vif_slot |= (1 << avp->index); 1183 priv->vif_slot |= (1 << avp->index);
1184 priv->nvifs++;
1183 priv->vif = vif; 1185 priv->vif = vif;
1184 1186
1185 ath_dbg(common, ATH_DBG_CONFIG, 1187 ath_dbg(common, ATH_DBG_CONFIG,