| To: | "David S. Miller" <davem@xxxxxxxxxx> |
|---|---|
| Subject: | [PATCH 2.5.70] net-sysfs parent ref count |
| From: | Stephen Hemminger <shemminger@xxxxxxxx> |
| Date: | Tue, 10 Jun 2003 13:35:08 -0700 |
| Cc: | netdev@xxxxxxxxxxx |
| Organization: | Open Source Development Lab |
| Sender: | netdev-bounce@xxxxxxxxxxx |
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;
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Route cache performance under stress, Robert Olsson |
|---|---|
| Next by Date: | RE: Route cache performance tests, CIT/Paul |
| Previous by Thread: | [RFC] assorted changes to atm protocol stack, chas williams |
| Next by Thread: | Re: [PATCH 2.5.70] net-sysfs parent ref count, David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |