diff options
-rw-r--r-- | drivers/net/team/team.c | 6 |
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, | |||
1167 | return -EBUSY; | 1167 | return -EBUSY; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | if (dev == port_dev) { | ||
1171 | NL_SET_ERR_MSG(extack, "Cannot enslave team device to itself"); | ||
1172 | netdev_err(dev, "Cannot enslave team device to itself\n"); | ||
1173 | return -EINVAL; | ||
1174 | } | ||
1175 | |||
1170 | if (port_dev->features & NETIF_F_VLAN_CHALLENGED && | 1176 | if (port_dev->features & NETIF_F_VLAN_CHALLENGED && |
1171 | vlan_uses_dev(dev)) { | 1177 | vlan_uses_dev(dev)) { |
1172 | NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up"); | 1178 | NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up"); |