aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_sysfs_br.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_sysfs_br.c')
-rw-r--r--net/bridge/br_sysfs_br.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 3312e8f2abe4..9cf0538d1717 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -426,16 +426,10 @@ int br_sysfs_addbr(struct net_device *dev)
426 goto out2; 426 goto out2;
427 } 427 }
428 428
429 429 br->ifobj = kobject_create_and_add(SYSFS_BRIDGE_PORT_SUBDIR, brobj);
430 kobject_set_name(&br->ifobj, SYSFS_BRIDGE_PORT_SUBDIR); 430 if (!br->ifobj) {
431 br->ifobj.ktype = NULL;
432 br->ifobj.kset = NULL;
433 br->ifobj.parent = brobj;
434
435 err = kobject_register(&br->ifobj);
436 if (err) {
437 pr_info("%s: can't add kobject (directory) %s/%s\n", 431 pr_info("%s: can't add kobject (directory) %s/%s\n",
438 __FUNCTION__, dev->name, kobject_name(&br->ifobj)); 432 __FUNCTION__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR);
439 goto out3; 433 goto out3;
440 } 434 }
441 return 0; 435 return 0;
@@ -453,7 +447,7 @@ void br_sysfs_delbr(struct net_device *dev)
453 struct kobject *kobj = &dev->dev.kobj; 447 struct kobject *kobj = &dev->dev.kobj;
454 struct net_bridge *br = netdev_priv(dev); 448 struct net_bridge *br = netdev_priv(dev);
455 449
456 kobject_unregister(&br->ifobj); 450 kobject_put(br->ifobj);
457 sysfs_remove_bin_file(kobj, &bridge_forward); 451 sysfs_remove_bin_file(kobj, &bridge_forward);
458 sysfs_remove_group(kobj, &bridge_group); 452 sysfs_remove_group(kobj, &bridge_group);
459} 453}