Search Linux Wireless

Re: cfg80211 wext compat w/o wext code changes, rtnl locking

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

 



On Fri, 2007-03-30 at 12:37 +0200, Johannes Berg wrote:
> On Fri, 2007-03-30 at 12:11 +0200, Michael Buesch wrote:
> > On Thursday 29 March 2007 01:00, Johannes Berg wrote:
> > > -			if(handler != NULL) {
> > > +			if (handler) {
> > > +				if (!dev->wireless_handlers->no_locking)
> > > +					rtnl_lock();
> > 
> > Is sparse OK with this conditional locking?
> 
> I also thought it wasn't but it didn't complain. The only reason why I
> didn't just duplicate the code was the deep indentation here...

Just for your information, rtnl_lock() is actually a mutex.  Neither
rtnl_lock() nor any mutex operation are annotated to give sparse any
idea of what they are doing.

If sparse learns about mutexes, expect it to give a warning.  Please
consider if the code between rtnl_lock() and rtnl_unlock() could be
moved to a separate function so that locking and unlocking would happen
in the same basic block.

-- 
Regards,
Pavel Roskin

-
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 Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux