diff options
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index f588e49c65f1..583a21c1def3 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2877,7 +2877,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev) | |||
2877 | { | 2877 | { |
2878 | struct igb_adapter *adapter = netdev_priv(netdev); | 2878 | struct igb_adapter *adapter = netdev_priv(netdev); |
2879 | struct e1000_hw *hw = &adapter->hw; | 2879 | struct e1000_hw *hw = &adapter->hw; |
2880 | struct dev_mc_list *mc_ptr = netdev->mc_list; | 2880 | struct dev_mc_list *mc_ptr; |
2881 | u8 *mta_list; | 2881 | u8 *mta_list; |
2882 | int i; | 2882 | int i; |
2883 | 2883 | ||
@@ -2893,14 +2893,10 @@ static int igb_write_mc_addr_list(struct net_device *netdev) | |||
2893 | return -ENOMEM; | 2893 | return -ENOMEM; |
2894 | 2894 | ||
2895 | /* The shared function expects a packed array of only addresses. */ | 2895 | /* The shared function expects a packed array of only addresses. */ |
2896 | mc_ptr = netdev->mc_list; | 2896 | i = 0; |
2897 | netdev_for_each_mc_addr(mc_ptr, netdev) | ||
2898 | memcpy(mta_list + (i++ * ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN); | ||
2897 | 2899 | ||
2898 | for (i = 0; i < netdev_mc_count(netdev); i++) { | ||
2899 | if (!mc_ptr) | ||
2900 | break; | ||
2901 | memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN); | ||
2902 | mc_ptr = mc_ptr->next; | ||
2903 | } | ||
2904 | igb_update_mc_addr_list(hw, mta_list, i); | 2900 | igb_update_mc_addr_list(hw, mta_list, i); |
2905 | kfree(mta_list); | 2901 | kfree(mta_list); |
2906 | 2902 | ||