On Tue, Jun 11, 2013 at 01:55:18PM +0200, Johannes Berg wrote: > On Wed, 2013-06-05 at 17:09 +0200, Antonio Quartulli wrote: > > > + if (need_offchan && !chan) > > + return -EINVAL; > > > @@ -2847,10 +2853,14 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, > > rcu_read_lock(); > > chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); > > > > - if (chanctx_conf) > > - need_offchan = chan != chanctx_conf->def.chan; > > - else > > + if (chanctx_conf) { > > + need_offchan = chan && (chan != chanctx_conf->def.chan); > > + } else if (!chan) { > > + ret = -EINVAL; > > + goto out_unlock; > > + } else { > > need_offchan = true; > > + } > > rcu_read_unlock(); > > It seems this would be clearer? > http://p.sipsolutions.net/b8a03c85f0e8b89f.txt agreed :) I'll include this change. Cheers, -- Antonio Quartulli ..each of us alone is worth nothing.. Ernesto "Che" Guevara