From: "Arend van Spriel" <arend@broadcom.com>
To: "Johannes Berg" <johannes@sipsolutions.net>
Cc: "Eliad Peller" <eliad@wizery.com>,
linux-wireless@vger.kernel.org,
"Michal Kazior" <michal.kazior@tieto.com>
Subject: Re: [PATCH 01/10] mac80211: introduce channel context skeleton code
Date: Sun, 16 Sep 2012 18:32:08 +0200 [thread overview]
Message-ID: <5055FF08.7000204@broadcom.com> (raw)
In-Reply-To: <CAB3XZEdAX8=BU5QQaQpS=OF-5XXDH=k3rO7C2z2F+sZpaCNK1Q@mail.gmail.com>
On 09/15/2012 11:42 PM, Eliad Peller wrote:
> On Fri, Sep 14, 2012 at 3:37 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
>> From: Michal Kazior <michal.kazior@tieto.com>
>>
>> Channel context are the foundation for multi-channel
>> operation. They are are immutable and are re-created
>> (or re-used if other interfaces are bound to a certain
>> channel and a compatible channel type) on channel
>> switching.
>>
>> This is an initial implementation and more features
>> will come in separate patches.
>>
>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>> [some changes including RCU protection]
>> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
>> ---
> [...]
>
>> +int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
>> + struct ieee80211_channel *channel,
>> + enum nl80211_channel_type channel_type,
>> + enum ieee80211_chanctx_mode mode)
>> +{
>> + struct ieee80211_local *local = sdata->local;
>> + struct ieee80211_chanctx *ctx;
>> + int ret;
>> +
>> + mutex_lock(&local->chanctx_mtx);
>> + __ieee80211_vif_release_channel(sdata);
>> +
>> + ctx = ieee80211_find_chanctx(local, channel, channel_type, mode);
> since you might use an existing ctx here...
>
>> + if (!ctx)
>> + ctx = ieee80211_new_chanctx(local, channel, channel_type, mode);
>> + if (IS_ERR(ctx)) {
>> + ret = PTR_ERR(ctx);
>> + goto out;
>> + }
>> +
>> + ret = ieee80211_assign_vif_chanctx(sdata, ctx);
>> + if (ret) {
>> + ieee80211_free_chanctx(local, ctx);
> i think you should check ctx->refcount before freeing it.
>
> Eliad.
Would it make sense to have the refcount check in
ieee80211_free_chanctx() instead of the WARN_ON_ONCE() in there.
Gr. AvS
next prev parent reply other threads:[~2012-09-16 16:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-14 12:37 [PATCH 00/10] mac80211 multi-channel work (final?) Johannes Berg
2012-09-14 12:37 ` [PATCH 01/10] mac80211: introduce channel context skeleton code Johannes Berg
2012-09-15 21:42 ` Eliad Peller
2012-09-16 16:32 ` Arend van Spriel [this message]
2012-09-17 14:54 ` Johannes Berg
2012-09-14 12:37 ` [PATCH 02/10] mac80211: introduce new ieee80211_ops Johannes Berg
2012-09-14 12:37 ` [PATCH 03/10] mac80211: use channel context notifications Johannes Berg
2012-09-14 12:37 ` [PATCH 04/10] mac80211: reuse channels for channel contexts Johannes Berg
2012-09-14 12:37 ` [PATCH 05/10] mac80211: check channel context methods Johannes Berg
2012-09-14 12:37 ` [PATCH 06/10] mac80211: track whether to use channel contexts Johannes Berg
2012-09-14 12:37 ` [PATCH 07/10] mac80211: " Johannes Berg
2012-09-14 12:37 ` [PATCH 08/10] mac80211: track needed RX chains for " Johannes Berg
2012-09-14 12:37 ` [PATCH 09/10] mac80211: add channel context iterator Johannes Berg
2012-09-14 12:37 ` [PATCH 10/10] mac80211_hwsim: use channel contexts Johannes Berg
2012-10-01 7:28 ` [PATCH 00/10] mac80211 multi-channel work (final?) Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5055FF08.7000204@broadcom.com \
--to=arend@broadcom.com \
--cc=eliad@wizery.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.