Commit faf460c4 authored by Stephen Hemminger's avatar Stephen Hemminger

[NET]: Fix sysfs kobj parent refcount handling.

parent 765ab8b0
......@@ -278,17 +278,11 @@ int netdev_register_sysfs(struct net_device *net)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment