ixgbe: do not use adapter->num_vfs when setting VFs via module parameter
Avoid setting adapter->num_vfs early in the init code path when using the max_vfs module parameter by passing it to ixgbe_enable_sriov() as a function parameter. This fixes an issue where if we failed to allocate vfinfo in __ixgbe_enable_sriov() the driver will crash with NULL pointer in ixgbe_disable_sriov() when attempting to free the vfinfo struct based on adapter->num_vfs. Also it cleans up the assignment of adapter->num_vfs since now it will only be set in __ixgbe_enable_sriov() and cleared in ixgbe_disable_sriov(). Signed-off-by:Emil Tantilov <emil.s.tantilov@intel.com> Tested-by:
Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by:
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Showing
- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 2 additions, 4 deletionsdrivers/net/ethernet/intel/ixgbe/ixgbe_main.c
- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c 25 additions, 25 deletionsdrivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h 1 addition, 1 deletiondrivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h
Please register or sign in to comment