Search Linux Wireless

Re: [PATCH] cfg80211: add get reg command

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

 



On Wed, 2009-01-28 at 06:44 -0800, Luis R. Rodriguez wrote:
> On Wed, Jan 28, 2009 at 02:17:21AM -0800, Johannes Berg wrote:
> > On Tue, 2009-01-27 at 18:52 -0800, Luis R. Rodriguez wrote:
> > 
> > > +	mutex_lock(&cfg80211_drv_mutex);
> > > +	regd = reg_get_current_rd();
> > > +	mutex_unlock(&cfg80211_drv_mutex);
> > > +
> > > +	if (!regd)
> > > +		goto out;
> > 
> > Any reason you need to copy and can't just build the whole thing under
> > lock?
> 
> Glad you asked, we can lock the entire call or we can do the above to
> copy. I picked a copy to not let a regular user (get reg can be called
> by anyone) abuse the lock as cfg80211_drv_mutex is used in a lot of places,
> I guess its silly but other's input on this is appreciated as well. Not sure
> if the copy was the best choice.

I don't really see much difference between locking to create a copy and
locking to create a copy in a different format, do you? Except to create
a copy needs to allocate memory which could take even longer.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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