From: Ido Schimmel Date: Thu, 3 Dec 2015 11:12:03 +0000 (+0100) Subject: net: Check CHANGEUPPER notifier return value X-Git-Tag: v4.1.12-124.31.3~410 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=168d38c5e1371eb28a31de9834eb9b99344e8ea1;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller (cherry picked from commit b03804e7c3ad41c265c0ca21ddb306b252b4f99f) Orabug: 28122104 Signed-off-by: Vijay Balakrishna Reviewed-by: Si-Wei Liu Reviewed-by: Shannon Nelson Signed-off-by: Brian Maly --- diff --git a/net/core/dev.c b/net/core/dev.c index a81d39c31ac6..74e259c88b77 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -5315,8 +5315,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: