diff options
author | Brett Creeley <brett.creeley@intel.com> | 2019-02-08 15:50:36 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2019-02-25 11:56:01 -0500 |
commit | b751930c6c21c3a6abc447f4f76fa2c28a11cb91 (patch) | |
tree | 072cc4c8c45b8b3570cb0c685662bfd13a5ce45c /drivers/net/ethernet/intel/ice/ice_lib.c | |
parent | 32a64994dbc3e79250f99802faddc074fa8ce667 (diff) |
ice: only use the VF for ICE_VSI_VF in ice_vsi_release
In ice_vsi_release we are always assigning a value to the local VF
variable. Change this to only be assigned if the VSI is a VF VSI.
Signed-off-by: Brett Creeley <brett.creeley@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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index d93a0d5a783c..fa61203bee26 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c | |||
@@ -2518,13 +2518,15 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi) | |||
2518 | */ | 2518 | */ |
2519 | int ice_vsi_release(struct ice_vsi *vsi) | 2519 | int ice_vsi_release(struct ice_vsi *vsi) |
2520 | { | 2520 | { |
2521 | struct ice_vf *vf = NULL; | ||
2521 | struct ice_pf *pf; | 2522 | struct ice_pf *pf; |
2522 | struct ice_vf *vf; | ||
2523 | 2523 | ||
2524 | if (!vsi->back) | 2524 | if (!vsi->back) |
2525 | return -ENODEV; | 2525 | return -ENODEV; |
2526 | pf = vsi->back; | 2526 | pf = vsi->back; |
2527 | vf = &pf->vf[vsi->vf_id]; | 2527 | |
2528 | if (vsi->type == ICE_VSI_VF) | ||
2529 | vf = &pf->vf[vsi->vf_id]; | ||
2528 | /* do not unregister and free netdevs while driver is in the reset | 2530 | /* do not unregister and free netdevs while driver is in the reset |
2529 | * recovery pending state. Since reset/rebuild happens through PF | 2531 | * recovery pending state. Since reset/rebuild happens through PF |
2530 | * service task workqueue, its not a good idea to unregister netdev | 2532 | * service task workqueue, its not a good idea to unregister netdev |