Skip to content

Commit fbd5eb5

Browse files
hramamu1Jeff Kirsher
authored andcommitted
i40evf: Use an iterator of the same type as the list
When iterating through the linked list of VLAN filters, make the iterator the same type as that of the linked list. Signed-off-by: Harshitha Ramamurthy <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent a48350c commit fbd5eb5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/ethernet/intel/i40evf/i40evf_main.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,7 @@ static void i40evf_up_complete(struct i40evf_adapter *adapter)
10271027
void i40evf_down(struct i40evf_adapter *adapter)
10281028
{
10291029
struct net_device *netdev = adapter->netdev;
1030+
struct i40evf_vlan_filter *vlf;
10301031
struct i40evf_mac_filter *f;
10311032

10321033
if (adapter->state <= __I40EVF_DOWN_PENDING)
@@ -1045,7 +1046,7 @@ void i40evf_down(struct i40evf_adapter *adapter)
10451046
f->remove = true;
10461047
}
10471048
/* remove all VLAN filters */
1048-
list_for_each_entry(f, &adapter->vlan_filter_list, list) {
1049+
list_for_each_entry(vlf, &adapter->vlan_filter_list, list) {
10491050
f->remove = true;
10501051
}
10511052

@@ -3067,6 +3068,7 @@ static void i40evf_remove(struct pci_dev *pdev)
30673068
{
30683069
struct net_device *netdev = pci_get_drvdata(pdev);
30693070
struct i40evf_adapter *adapter = netdev_priv(netdev);
3071+
struct i40evf_vlan_filter *vlf, *vlftmp;
30703072
struct i40evf_mac_filter *f, *ftmp;
30713073
struct i40e_hw *hw = &adapter->hw;
30723074
int err;
@@ -3129,9 +3131,10 @@ static void i40evf_remove(struct pci_dev *pdev)
31293131
list_del(&f->list);
31303132
kfree(f);
31313133
}
3132-
list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) {
3133-
list_del(&f->list);
3134-
kfree(f);
3134+
list_for_each_entry_safe(vlf, vlftmp, &adapter->vlan_filter_list,
3135+
list) {
3136+
list_del(&vlf->list);
3137+
kfree(vlf);
31353138
}
31363139

31373140
spin_unlock_bh(&adapter->mac_vlan_list_lock);

0 commit comments

Comments
 (0)