[PATCH 2.5.70] net-sysfs parent ref count

STALE8528d

2 messages, 2 authors, 2003-06-12 · open the first message on its own page

[PATCH 2.5.70] net-sysfs parent ref count

From: Stephen Hemminger <hidden>
Date: 2003-06-10 20:35:08

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;
 

Re: [PATCH 2.5.70] net-sysfs parent ref count

From: David S. Miller <hidden>
Date: 2003-06-12 06:58:23

   From: Stephen Hemminger [off-list ref]
   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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help