Skip to content

Commit

Permalink
net: bridge: set error code on failure
Browse files Browse the repository at this point in the history
Function br_sysfs_addbr() does not set error code when the call
kobject_create_and_add() returns a NULL pointer. It may be better to
return "-ENOMEM" when kobject_create_and_add() fails.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188781

Signed-off-by: Pan Bian <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
SinkFinder authored and davem330 committed Dec 5, 2016
1 parent 14dd3e1 commit b595896
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/bridge/br_sysfs_br.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ int br_sysfs_addbr(struct net_device *dev)
if (!br->ifobj) {
pr_info("%s: can't add kobject (directory) %s/%s\n",
__func__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR);
err = -ENOMEM;
goto out3;
}
return 0;
Expand Down

0 comments on commit b595896

Please sign in to comment.