lkml.org 
[lkml]   [2003]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectDriver model: releasing parents before children
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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.015 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site