linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Driver model: releasing parents before children
@ 2003-12-18 17:02 Alan Stern
  0 siblings, 0 replies; only message in thread
From: Alan Stern @ 2003-12-18 17:02 UTC (permalink / raw)
  To: Greg KH; +Cc: Kernel development list

Greg:

You recently modified kobject.c to fix a bug wherein a kobject's parent
could get freed before the kobject itself, because kobject_put() on the
parent was done in the wrong place, during kobject_del() rather than
kobject_cleanup().

I just noticed two things about this.  First, you neglected to remove the 
comment from kobject.c:unlink() about decrementing the parent's refcount.

Second, the same bug appears to need fixing in the driver model core.  A 
device's parent's refcount is decremented in device_del(), not in 
device_release().  There may be other instances as well; I haven't looked.

Alan Stern



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-18 17:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-18 17:02 Driver model: releasing parents before children Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).