aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_lib.c
diff options
context:
space:
mode:
authorAkeem G Abodunrin <akeem.g.abodunrin@intel.com>2019-02-28 18:25:57 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-05-02 04:17:37 -0400
commit5079b853b221005ac06192265c917ea79c11c0e2 (patch)
tree1e561fe91d0b2195157a703b1e6c3bfa26032757 /drivers/net/ethernet/intel/ice/ice_lib.c
parentacd1751a3988e45e3464c9405dc5b95deb55865d (diff)
ice: Fix issue when adding more than allowed VLANs
This patch fixes issue with non trusted VFs being able to add more than permitted number of VLANs by adding a check in ice_vc_process_vlan_msg. Also don't return an error in this case as the VF does not need to know that it is not trusted. Also rework ice_vsi_kill_vlan to use the right types. Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lib.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_lib.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index 8e0a23e6b563..6d9571c8826d 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1598,7 +1598,8 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)
1598 struct ice_fltr_list_entry *list; 1598 struct ice_fltr_list_entry *list;
1599 struct ice_pf *pf = vsi->back; 1599 struct ice_pf *pf = vsi->back;
1600 LIST_HEAD(tmp_add_list); 1600 LIST_HEAD(tmp_add_list);
1601 int status = 0; 1601 enum ice_status status;
1602 int err = 0;
1602 1603
1603 list = devm_kzalloc(&pf->pdev->dev, sizeof(*list), GFP_KERNEL); 1604 list = devm_kzalloc(&pf->pdev->dev, sizeof(*list), GFP_KERNEL);
1604 if (!list) 1605 if (!list)
@@ -1614,14 +1615,16 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)
1614 INIT_LIST_HEAD(&list->list_entry); 1615 INIT_LIST_HEAD(&list->list_entry);
1615 list_add(&list->list_entry, &tmp_add_list); 1616 list_add(&list->list_entry, &tmp_add_list);
1616 1617
1617 if (ice_remove_vlan(&pf->hw, &tmp_add_list)) { 1618 status = ice_remove_vlan(&pf->hw, &tmp_add_list);
1618 dev_err(&pf->pdev->dev, "Error removing VLAN %d on vsi %i\n", 1619 if (status) {
1619 vid, vsi->vsi_num); 1620 dev_err(&pf->pdev->dev,
1620 status = -EIO; 1621 "Error removing VLAN %d on vsi %i error: %d\n",
1622 vid, vsi->vsi_num, status);
1623 err = -EIO;
1621 } 1624 }
1622 1625
1623 ice_free_fltr_list(&pf->pdev->dev, &tmp_add_list); 1626 ice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);
1624 return status; 1627 return err;
1625} 1628}
1626 1629
1627/** 1630/**