]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ice: only use the VF for ICE_VSI_VF in ice_vsi_release
authorBrett Creeley <brett.creeley@intel.com>
Fri, 8 Feb 2019 20:50:36 +0000 (12:50 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 25 Feb 2019 16:56:01 +0000 (08:56 -0800)
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>
drivers/net/ethernet/intel/ice/ice_lib.c

index d93a0d5a783c040341e7ae502940f9e10ecbe082..fa61203bee2694d028a0186c82f9ace77dd544ba 100644 (file)
@@ -2518,13 +2518,15 @@ void ice_vsi_dis_irq(struct ice_vsi *vsi)
  */
 int ice_vsi_release(struct ice_vsi *vsi)
 {
+       struct ice_vf *vf = NULL;
        struct ice_pf *pf;
-       struct ice_vf *vf;
 
        if (!vsi->back)
                return -ENODEV;
        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
         * recovery pending state. Since reset/rebuild happens through PF
         * service task workqueue, its not a good idea to unregister netdev