* [PATCH 2.5.70] net-sysfs parent ref count
@ 2003-06-10 20:35 Stephen Hemminger
2003-06-12 6:58 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2003-06-10 20:35 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
When creating network sysfs entries, we grab an extra reference to the parent.
Not a big deal now, since it just gets blown away on unregister anyway, but when
kobject reference counts are used for release, things break.
diff -Nru a/net/core/net-sysfs.c b/net/core/net-sysfs.c
--- a/net/core/net-sysfs.c Tue Jun 10 11:11:42 2003
+++ b/net/core/net-sysfs.c Tue Jun 10 11:11:42 2003
@@ -299,17 +299,11 @@
goto out_unreg;
}
-
net->stats_kobj.parent = NULL;
if (net->get_stats) {
struct kobject *k = &net->stats_kobj;
- k->parent = kobject_get(&class_dev->kobj);
- if (!k->parent) {
- ret = -EBUSY;
- goto out_unreg;
- }
-
+ k->parent = &class_dev->kobj;
strlcpy(k->name, "statistics", KOBJ_NAME_LEN);
k->ktype = &netstat_ktype;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.5.70] net-sysfs parent ref count
2003-06-10 20:35 [PATCH 2.5.70] net-sysfs parent ref count Stephen Hemminger
@ 2003-06-12 6:58 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-06-12 6:58 UTC (permalink / raw)
To: shemminger; +Cc: netdev
From: Stephen Hemminger <shemminger@osdl.org>
Date: Tue, 10 Jun 2003 13:35:08 -0700
When creating network sysfs entries, we grab an extra reference to
the parent. Not a big deal now, since it just gets blown away on
unregister anyway, but when kobject reference counts are used for
release, things break.
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-12 6:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-10 20:35 [PATCH 2.5.70] net-sysfs parent ref count Stephen Hemminger
2003-06-12 6:58 ` David S. Miller
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).