Re: [PATCH] net: mac80211: tx.c: be sure of 'sdata->vif.type' must be NL80211_IFTYPE_AP when be in NL80211_IFTYPE_AP case

Johannes Berg
2013-12-01T09:35:40Z

On Sat, 2013-11-30 at 12:39 -0800, Joe Perches wrote:

> +++ b/net/mac80211/tx.c
> @@ -1777,18 +1777,16 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
> }
> ap_sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
> u.ap);
> - chanctx_conf = rcu_dereference(ap_sdata->vif.chanctx_conf);
> - if (!chanctx_conf)
> - goto fail_rcu;
> - band = chanctx_conf->def.chan->band;
> - if (sta)
> - break;
> /* fall through */
> case NL80211_IFTYPE_AP:
> - if (sdata->vif.type == NL80211_IFTYPE_AP)
> - chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
> + chanctx_conf = rcu_dereference(ap_sdata->vif.chanctx_conf);

Good try, but no, now ap_sdata isn't even assigned. :)

johannes