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) ...@@ -278,17 +278,11 @@ int netdev_register_sysfs(struct net_device *net)
goto out_unreg; goto out_unreg;
} }
net->stats_kobj.parent = NULL; net->stats_kobj.parent = NULL;
if (net->get_stats) { if (net->get_stats) {
struct kobject *k = &net->stats_kobj; struct kobject *k = &net->stats_kobj;
k->parent = kobject_get(&class_dev->kobj); k->parent = &class_dev->kobj;
if (!k->parent) {
ret = -EBUSY;
goto out_unreg;
}
strlcpy(k->name, "statistics", KOBJ_NAME_LEN); strlcpy(k->name, "statistics", KOBJ_NAME_LEN);
k->ktype = &netstat_ktype; 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