igc: Improve address check in igc_del_mac_filter()
authorAndre Guedes <andre.guedes@intel.com>
Wed, 18 Mar 2020 23:00:56 +0000 (16:00 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sun, 19 Apr 2020 18:59:24 +0000 (11:59 -0700)
igc_add_mac_filter() doesn't allow filters with invalid MAC address to
be added to adapter->mac_table so, in igc_del_mac_filter(), we can early
return if MAC address is invalid. No need to traverse the table.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igc/igc_main.c

index 2f6c8f7fa6f4153c00e165c57b50bba5765ed7f0..070df92bb4e95148b9654ae30487b67629ae48fe 100644 (file)
@@ -2246,7 +2246,7 @@ static int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
        int rar_entries = hw->mac.rar_entry_count;
        int i;
 
-       if (is_zero_ether_addr(addr))
+       if (!is_valid_ether_addr(addr))
                return -EINVAL;
 
        /* Search for matching entry in the MAC table based on given address