Commit b5958963 authored by Pan Bian's avatar Pan Bian Committed by David S. Miller

net: bridge: set error code on failure

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=188781Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
Acked-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 14dd3e1b
...@@ -898,6 +898,7 @@ int br_sysfs_addbr(struct net_device *dev) ...@@ -898,6 +898,7 @@ int br_sysfs_addbr(struct net_device *dev)
if (!br->ifobj) { if (!br->ifobj) {
pr_info("%s: can't add kobject (directory) %s/%s\n", pr_info("%s: can't add kobject (directory) %s/%s\n",
__func__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR); __func__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR);
err = -ENOMEM;
goto out3; goto out3;
} }
return 0; return 0;
......
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