On Wed, 28 Nov 2007, Greg KH wrote:You don't need to set kset, do you? Or parent -- especially if kset is set instead. Certainly kobjects without one or the other of those are useful. IMO it's better to let people know up front. Otherwise they might get some misconception fixed in their brain, misdesign their drivers, and have to change a large hunk of code when they discover it doesn't work at runtime. That's the whole point of documentation in the first place, right? To tell people how the code is supposed to be used. Let's see. The error scenario you propose is that a loadable module contains a static kobject and the kobject's refcount is still positive when the module is unloaded. Then the holder of the remaining reference tries to access the kobject and crashes. Yes, that's bad. But turn it around: Suppose the kobject were allocated dynamically instead. It would remain in memory when the owning module was unloaded, but its release method would go away along with the rest of the module. When the last remaining reference is dropped there would be a crash anyway. Evidently the bug here is allowing the module to be unloaded while one of its kobjects still has a positive refcount. It doesn't matter whether the kobject was allocated statically or dynamically. What about static kobjects in built-in (non-modular) kernel code? Especially if the kobject in question is never released? Alan Stern -
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| James Bottomley | Re: Announce: Linux-next (Or Andrew's dream :-)) |
| David Woodhouse | Re: [PATCH 2/3] firmware: convert korg1212 driver to use firmware loader exclusively |
| Kamalesh Babulal | Re: 2.6.24-rc8-mm1 Build Failure on S390x |
git: | |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
