Skip to content

Commit 8a4a126

Browse files
ndnunleyanguy11
authored andcommitted
iavf: check for null in iavf_fix_features
If the driver has lost contact with the PF then it enters a disabled state and frees adapter->vf_res. However, ndo_fix_features can still be called on the interface, so we need to check for this condition first. Since we have no information on the features at this time simply leave them unmodified and return. Fixes: c4445ae ("i40evf: Fix VLAN features") Signed-off-by: Nicholas Nunley <[email protected]> Tested-by: Tony Brelinski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 4e5e6b5 commit 8a4a126

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3503,7 +3503,8 @@ static netdev_features_t iavf_fix_features(struct net_device *netdev,
35033503
{
35043504
struct iavf_adapter *adapter = netdev_priv(netdev);
35053505

3506-
if (!(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
3506+
if (adapter->vf_res &&
3507+
!(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
35073508
features &= ~(NETIF_F_HW_VLAN_CTAG_TX |
35083509
NETIF_F_HW_VLAN_CTAG_RX |
35093510
NETIF_F_HW_VLAN_CTAG_FILTER);

0 commit comments

Comments
 (0)