diff options
author | Pan Bian <bianpan2016@163.com> | 2016-12-03 14:33:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-05 21:26:22 +0300 |
commit | b59589635ff01cc25270360709eeeb5c45c6abb9 (patch) | |
tree | ab5c7b39e13735739f41a8a2eb9cc18bcd14ccda | |
parent | 14dd3e1b970feb125e4f453bc3b0569db5b2069b (diff) | |
download | linux-b59589635ff01cc25270360709eeeb5c45c6abb9.tar.xz |
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=188781
Signed-off-by: Pan Bian <bianpan2016@163.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bridge/br_sysfs_br.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index e120307c6e36..f88c4df3f91e 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c @@ -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; |