Commit b751930c authored by Brett Creeley's avatar Brett Creeley Committed by Jeff Kirsher

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: default avatarBrett Creeley <brett.creeley@intel.com>
Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 32a64994
...@@ -2518,13 +2518,15 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi) ...@@ -2518,13 +2518,15 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi)
*/ */
int ice_vsi_release(struct ice_vsi *vsi) int ice_vsi_release(struct ice_vsi *vsi)
{ {
struct ice_vf *vf = NULL;
struct ice_pf *pf; struct ice_pf *pf;
struct ice_vf *vf;
if (!vsi->back) if (!vsi->back)
return -ENODEV; return -ENODEV;
pf = vsi->back; pf = vsi->back;
vf = &pf->vf[vsi->vf_id];
if (vsi->type == ICE_VSI_VF)
vf = &pf->vf[vsi->vf_id];
/* do not unregister and free netdevs while driver is in the reset /* do not unregister and free netdevs while driver is in the reset
* recovery pending state. Since reset/rebuild happens through PF * recovery pending state. Since reset/rebuild happens through PF
* service task workqueue, its not a good idea to unregister netdev * service task workqueue, its not a good idea to unregister netdev
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment