aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2015-12-03 12:12:03 +0100
committerDavid S. Miller <davem@davemloft.net>2015-12-03 11:49:23 -0500
commitb03804e7c3ad41c265c0ca21ddb306b252b4f99f (patch)
treea887cd7567a12b2c87f5d9e01bacc75c461f7231 /net
parenti40e: Fix i40e_print_features() VEB mode output (diff)
downloadlinux-dev-b03804e7c3ad41c265c0ca21ddb306b252b4f99f.tar.xz
linux-dev-b03804e7c3ad41c265c0ca21ddb306b252b4f99f.zip
net: Check CHANGEUPPER notifier return value
switchdev drivers reflect the newly requested topology to hardware when CHANGEUPPER is received, after software links were already formed. However, the operation can fail and user will not be notified, as the return value of the notifier is not checked. Add this check and rollback software links if necessary. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 5df6cbce727c..939cd1b1da15 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5490,8 +5490,12 @@ static int __netdev_upper_dev_link(struct net_device *dev,
goto rollback_lower_mesh;
}
- call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
- &changeupper_info.info);
+ ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
+ &changeupper_info.info);
+ ret = notifier_to_errno(ret);
+ if (ret)
+ goto rollback_lower_mesh;
+
return 0;
rollback_lower_mesh: