Re: [PATCH 2/3] staging: brcm80211: making device object accessible from wlc and phy

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

 



On Thu, Apr 21, 2011 at 11:31:05AM +0200, Roland Vossen wrote:
> On 04/20/2011 11:10 PM, Greg KH wrote:
> >Whenever you save off a pointer to a struct device that you do not own,
> >you MUST increase the reference count, otherwise it could disappear
> >underneath you and you would never know it.
> >
> >So please do the proper increment/decrement when you are messing with
> >stuff like this, otherwise debugging your driver errors on unexpected
> >device removal is going to be a nightmare.
> 
> Thanks for the remark. Will do that in an upcoming v2 patch series.
> 
> I have a question: I grepped the directories:
> 
> net/mac80211, drivers/net/wireless and drivers/staging
> 
> for the following terms:
> 
> 'kobj'
> 'get_device'
> 
> but see very little calls to get_device() or kobj_*() functions.
> Does that match your expectation ?

Yes, why would a normal driver ever mess with a "raw" kobject or struct
device?  They would use the standard functions to properly handle this
type of reference counting depending on their subsystem type (hint, you
should be doing this from the network device structure functions...)

good luck,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux