summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@intel.com>2020-04-24 23:16:15 +0300
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2020-05-23 04:21:51 +0300
commit4bdf89e85ed3881e8c40510ebad918dded9e5831 (patch)
tree5f9126344d798b0f752bfbf290c81e9528108477
parentb500350a36ae6e83a03931723b787b771f411817 (diff)
downloadlinux-4bdf89e85ed3881e8c40510ebad918dded9e5831.tar.xz
igc: Fix NFC rule overwrite cases
When the 'loc' argument is passed in ethtool, the input rule overwrites any rule present in that location. In this situation we must disable the old rule otherwise it is left enabled in hardware. This patch fixes the issue by always calling igc_disable_nfc_rule() when deleting the old rule, no matter the value of 'input' argument. 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>
-rw-r--r--drivers/net/ethernet/intel/igc/igc_ethtool.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index decd29fbfbe2..f01a7ec0c1c2 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1270,8 +1270,7 @@ static int igc_ethtool_update_nfc_rule(struct igc_adapter *adapter,
/* if there is an old rule occupying our place remove it */
if (rule && rule->location == location) {
- if (!input)
- err = igc_disable_nfc_rule(adapter, rule);
+ err = igc_disable_nfc_rule(adapter, rule);
hlist_del(&rule->nfc_node);
kfree(rule);