summaryrefslogtreecommitdiffstats
path: root/drivers/net/team/team.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-08 15:43:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-08 15:43:12 +0200
commit4e1a606d552de03aec2b1fd157011bf012fcc870 (patch)
tree7d7683fc2d5286a36782df572f475abb3bb2e173 /drivers/net/team/team.c
parentTTY: sn_console: Replace spin_is_locked() with spin_trylock() (diff)
parentLinux 4.19-rc7 (diff)
downloadlinux-4e1a606d552de03aec2b1fd157011bf012fcc870.tar.xz
linux-4e1a606d552de03aec2b1fd157011bf012fcc870.zip
Merge 4.19-rc7 into tty-next
We want the fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/team/team.c')
-rw-r--r--drivers/net/team/team.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 6a047d30e8c6..d887016e54b6 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1167,6 +1167,12 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
return -EBUSY;
}
+ if (dev == port_dev) {
+ NL_SET_ERR_MSG(extack, "Cannot enslave team device to itself");
+ netdev_err(dev, "Cannot enslave team device to itself\n");
+ return -EINVAL;
+ }
+
if (port_dev->features & NETIF_F_VLAN_CHALLENGED &&
vlan_uses_dev(dev)) {
NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up");