break;
}
case NL80211_IFTYPE_AP:
- sdata->bss = &sdata->u.ap;
- break;
case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_MONITOR:
local->reconfig_failure = false;
res = drv_start(local);
- if (res)
- goto err_del_bss;
+ if (res) {
+ /*
+ * no need to worry about AP_VLAN cleanup since in that
+ * case we can't have open_count == 0
+ */
+ return res;
+ }
ieee80211_led_radio(local, true);
ieee80211_mod_tpt_led_trig(local,
IEEE80211_TPT_LEDTRIG_FL_RADIO, 0);
netif_carrier_on(dev);
list_add_tail_rcu(&sdata->u.mntr.list, &local->mon_list);
break;
+ case NL80211_IFTYPE_AP:
+ sdata->bss = &sdata->u.ap;
+ fallthrough;
default:
if (coming_up) {
ieee80211_del_virtual_monitor(local);
err_stop:
if (!local->open_count)
drv_stop(local, false);
- err_del_bss:
- sdata->bss = NULL;
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
list_del(&sdata->u.vlan.list);
+ /* Might not be initialized yet, but it is harmless */
+ sdata->bss = NULL;
return res;
}