Search Linux Wireless

Re: [PATCH] mac80211: check add_chanctx callback before use in ieee80211_reconfig

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2012-11-19 at 15:36 +0200, Eliad Peller wrote:
> hi Arend,
> 
> On Mon, Nov 19, 2012 at 1:01 PM, Arend van Spriel <arend@xxxxxxxxxxxx> wrote:
> > During testing our mac80211 driver a fatal error occurred which was
> > signalled to mac80211. Upon performing the reconfiguration of the
> > device a WARN_ON was triggered. This warning checked the return value
> > of drv_add_chanctx(). However, this returns -EOPNOTSUPP when the
> > driver does not provide the callback. As the callback is optional
> > better check it is defined before calling drv_add_chanctx().
> >
> > Signed-off-by: Arend van Spriel <arend@xxxxxxxxxxxx>
> > ---
> 
> > +       if (local->ops->add_chanctx) {
> > +               mutex_lock(&local->chanctx_mtx);
> > +               list_for_each_entry(ctx, &local->chanctx_list, list)
> > +                       WARN_ON(drv_add_chanctx(local, ctx));
> > +               mutex_unlock(&local->chanctx_mtx);
> > +       }
> 
> i think checking local->use_chanctx is a bit cleaner.

Makes sense, I'll apply with this change.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux