summaryrefslogtreecommitdiff
path: root/drivers/net/team/team.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-10-07 00:43:42 +0300
committerDavid S. Miller <davem@davemloft.net>2018-10-07 00:43:42 +0300
commit72438f8cef4e75a22140853baa4c68392c721b22 (patch)
tree78b7b6dafd827e0d55150a227db3978d91c0b6dd /drivers/net/team/team.c
parentfb4ee67529ff3e4c5874768477887c2df5714c96 (diff)
parentc1d84a1b42ef70d8ae601df9cadedc7ed4f1beb1 (diff)
downloadlinux-72438f8cef4e75a22140853baa4c68392c721b22.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
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");