Patch "iavf: check for null in iavf_fix_features" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iavf: check for null in iavf_fix_features

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iavf-check-for-null-in-iavf_fix_features.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4b3c74718f59ed553bfdb2b27af8a759b3ce118d
Author: Nicholas Nunley <nicholas.d.nunley@xxxxxxxxx>
Date:   Fri Jun 4 09:48:53 2021 -0700

    iavf: check for null in iavf_fix_features
    
    [ Upstream commit 8a4a126f4be88eb8b5f00a165ab58c35edf4ef76 ]
    
    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@xxxxxxxxx>
    Tested-by: Tony Brelinski <tony.brelinski@xxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index ac5709624c7ad..1fd8cc5ac306c 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -3185,7 +3185,8 @@ static netdev_features_t i40evf_fix_features(struct net_device *netdev,
 {
 	struct i40evf_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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux