All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net 1/8] iavf: check for null in iavf_fix_features
@ 2021-06-04 16:48 Tony Nguyen
  2021-06-04 16:48 ` [Intel-wired-lan] [PATCH net 2/8] iavf: free q_vectors before queues in iavf_disable_vf Tony Nguyen
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Tony Nguyen @ 2021-06-04 16:48 UTC (permalink / raw)
  To: intel-wired-lan

From: Nicholas Nunley <nicholas.d.nunley@intel.com>

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: c4445aedfe09 ("i40evf: Fix VLAN features")
Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index fb4e3fe5cd1b..ad3f804f0e14 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -3437,7 +3437,8 @@ static netdev_features_t iavf_fix_features(struct net_device *netdev,
 {
 	struct iavf_adapter *adapter = netdev_priv(netdev);
 
-	if (!(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
+	if (adapter->vf_res &&
+	    !(adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN))
 		features &= ~(NETIF_F_HW_VLAN_CTAG_TX |
 			      NETIF_F_HW_VLAN_CTAG_RX |
 			      NETIF_F_HW_VLAN_CTAG_FILTER);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-11-01 23:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 16:48 [Intel-wired-lan] [PATCH net 1/8] iavf: check for null in iavf_fix_features Tony Nguyen
2021-06-04 16:48 ` [Intel-wired-lan] [PATCH net 2/8] iavf: free q_vectors before queues in iavf_disable_vf Tony Nguyen
2021-11-01 23:04   ` Brelinski, Tony
2021-06-04 16:48 ` [Intel-wired-lan] [PATCH net 3/8] iavf: don't clear a lock we don't hold Tony Nguyen
2021-11-01 23:03   ` Brelinski, Tony
2021-06-04 16:48 ` [Intel-wired-lan] [PATCH net 4/8] iavf: Fix failure to exit out from last all-multicast mode Tony Nguyen
2021-11-01 23:03   ` Brelinski, Tony
2021-06-04 16:48 ` [Intel-wired-lan] [PATCH net 5/8] iavf: prevent accidental free of filter structure Tony Nguyen
2021-11-01 23:02   ` Brelinski, Tony
2021-06-04 16:48 ` [Intel-wired-lan] [PATCH net 6/8] iavf: validate pointers Tony Nguyen
2021-11-01 23:02   ` Brelinski, Tony
2021-06-04 16:48 ` [Intel-wired-lan] [PATCH net 7/8] iavf: Fix for the false positive ASQ/ARQ errors while issuing VF reset Tony Nguyen
2021-11-01 23:05   ` Brelinski, Tony
2021-06-04 16:49 ` [Intel-wired-lan] [PATCH net 8/8] iavf: Fix for setting queues to 0 Tony Nguyen
2021-11-01 23:01   ` Brelinski, Tony
2021-11-01 23:04 ` [Intel-wired-lan] [PATCH net 1/8] iavf: check for null in iavf_fix_features Brelinski, Tony

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.