Commit c862cc9b authored by Bastien Philbert's avatar Bastien Philbert Committed by David S. Miller
Browse files

bridge: Fix incorrect variable assignment on error path in br_sysfs_addbr



This fixes the incorrect variable assignment on error path in
br_sysfs_addbr for when the call to kobject_create_and_add
fails to assign the value of -EINVAL to the returned variable of
err rather then incorrectly return zero making callers think this
function has succeededed due to the previous assignment being
assigned zero when assigning it the successful return value of
the call to sysfs_create_group which is zero.

Signed-off-by: default avatarBastien Philbert <bastienphilbert@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be447f30
......@@ -870,6 +870,7 @@ int br_sysfs_addbr(struct net_device *dev)
br->ifobj = kobject_create_and_add(SYSFS_BRIDGE_PORT_SUBDIR, brobj);
if (!br->ifobj) {
err = -EINVAL;
pr_info("%s: can't add kobject (directory) %s/%s\n",
__func__, dev->name, SYSFS_BRIDGE_PORT_SUBDIR);
goto out3;
......
Supports Markdown
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