diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-19 06:47:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-19 06:47:01 +0100 |
commit | 73709e1af5163ebf5e9b0e18fe90b7e843657d36 (patch) | |
tree | 91ca8b98187ba60e88f8df2e32147fdf651f159e /net/core/dev.c | |
parent | c26dd817d99bc50acf2667ee27c39414a7a6638e (diff) | |
parent | c698ca5278934c0ae32297a8725ced2e27585d7f (diff) | |
download | blackbird-op-linux-73709e1af5163ebf5e9b0e18fe90b7e843657d36.tar.gz blackbird-op-linux-73709e1af5163ebf5e9b0e18fe90b7e843657d36.zip |
Merge 4.16-rc6 into staging-next
We want the staging fixes in here as well to handle merge/test issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index d4362befe7e2..2cedf520cb28 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6396,6 +6396,7 @@ static int __netdev_upper_dev_link(struct net_device *dev, .linking = true, .upper_info = upper_info, }; + struct net_device *master_dev; int ret = 0; ASSERT_RTNL(); @@ -6407,11 +6408,14 @@ static int __netdev_upper_dev_link(struct net_device *dev, if (netdev_has_upper_dev(upper_dev, dev)) return -EBUSY; - if (netdev_has_upper_dev(dev, upper_dev)) - return -EEXIST; - - if (master && netdev_master_upper_dev_get(dev)) - return -EBUSY; + if (!master) { + if (netdev_has_upper_dev(dev, upper_dev)) + return -EEXIST; + } else { + master_dev = netdev_master_upper_dev_get(dev); + if (master_dev) + return master_dev == upper_dev ? -EEXIST : -EBUSY; + } ret = call_netdevice_notifiers_info(NETDEV_PRECHANGEUPPER, &changeupper_info.info); |