From: Andre Guedes Date: Wed, 18 Mar 2020 23:00:56 +0000 (-0700) Subject: igc: Improve address check in igc_del_mac_filter() X-Git-Tag: v5.8-rc1~165^2~482^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a73eb651005eef079a6bf3b448d1b6eb607bc80b;p=thirdparty%2Flinux.git igc: Improve address check in igc_del_mac_filter() 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 Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 2f6c8f7fa6f41..070df92bb4e95 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -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