Return-path: Received: from s3.sipsolutions.net ([144.76.43.152]:54267 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758041Ab3FCSQI (ORCPT ); Mon, 3 Jun 2013 14:16:08 -0400 Message-ID: <1370283363.8227.27.camel@jlt4.sipsolutions.net> (sfid-20130603_201611_634982_A8794125) Subject: Re: [PATCH 2/2] mac80211: in mgmt_tx use the current channel if none has been specified From: Johannes Berg To: Antonio Quartulli Cc: linux-wireless@vger.kernel.org, Antonio Quartulli Date: Mon, 03 Jun 2013 20:16:03 +0200 In-Reply-To: <20130603180320.GF1226@ritirata.org> References: <1370241587-2609-1-git-send-email-ordex@autistici.org> <1370241587-2609-2-git-send-email-ordex@autistici.org> <1370271690.8227.18.camel@jlt4.sipsolutions.net> <20130603180320.GF1226@ritirata.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, 2013-06-03 at 20:03 +0200, Antonio Quartulli wrote: > On Mon, Jun 03, 2013 at 05:01:30PM +0200, Johannes Berg wrote: > > On Mon, 2013-06-03 at 08:39 +0200, Antonio Quartulli wrote: > > > > > @@ -2845,6 +2852,10 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, > > > rcu_read_lock(); > > > chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); > > > > > > + /* if no channel was specified, use the current one */ > > > + if (chanctx_conf && !chan) > > > + chan = chanctx_conf->def.chan; > > > + > > > if (chanctx_conf) > > > need_offchan = chan != chanctx_conf->def.chan; > > > else > > > @@ -2852,6 +2863,12 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, > > > rcu_read_unlock(); > > > } > > > > > > + /* at this point a channel should have been chosen */ > > > + if (!chan) { > > > + ret = -EINVAL; > > > + goto out_unlock; > > > + } > > > + > > > > These two changes make no sense at all. If you look at the function > > you'll see that "chan" isn't used at all after the check, > > uhm? it is passed to ieee80211_start_roc_work() right after (this part has not > been changed). > 2904 ret = ieee80211_start_roc_work(local, sdata, chan, No, you can't get there without need_offchan. johannes