summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex
diff options
context:
space:
mode:
authorSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>2016-02-03 09:49:18 +0530
committerDavid S. Miller <davem@davemloft.net>2016-02-07 13:55:22 -0500
commit41dcdfbd0944a3ef08224a8c9ba3b2fdeae0dd86 (patch)
tree3863ee1935b31e76bced7a894139319cf5d9b32b /drivers/net/ethernet/emulex
parentfa5c867d4df275a2c11a455043848574e80a8b32 (diff)
downloadlinux-stable-41dcdfbd0944a3ef08224a8c9ba3b2fdeae0dd86.tar.gz
linux-stable-41dcdfbd0944a3ef08224a8c9ba3b2fdeae0dd86.tar.bz2
linux-stable-41dcdfbd0944a3ef08224a8c9ba3b2fdeae0dd86.zip
be2net: Fix be_vlan_rem_vid() to check vlan id being removed
The driver decrements its vlan count without checking if it is really present in its list. This results in an invalid vlan count and impacts subsequent vlan add/rem ops. The function be_vlan_rem_vid() should be updated to fix this. Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f99de3657ce3..09e6f2cdfc90 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1463,6 +1463,9 @@ static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid)
if (lancer_chip(adapter) && vid == 0)
return 0;
+ if (!test_bit(vid, adapter->vids))
+ return 0;
+
clear_bit(vid, adapter->vids);
adapter->vlans_added--;