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>
if (priv->nvifs >= ATH9K_HTC_MAX_VIF) {
ret = -ENOBUFS;
- goto out;
+ mutex_unlock(&priv->mutex);
+ return ret;
}
ath9k_htc_ps_wakeup(priv);
if (ret)
goto out;
- priv->nvifs++;
-
/*
* We need a node in target to tx mgmt frames
* before association.
*/
ret = ath9k_htc_add_station(priv, vif, NULL);
- if (ret)
+ if (ret) {
+ WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif);
goto out;
+ }
priv->ah->opmode = vif->type;
priv->vif_slot |= (1 << avp->index);
+ priv->nvifs++;
priv->vif = vif;
ath_dbg(common, ATH_DBG_CONFIG,