Skip to content

Commit 07f3701

Browse files
jacob-kellerJeff Kirsher
authored andcommitted
i40e: fix condition of WARN_ONCE for stat strings
Commit 9b10df5 ("i40e: use WARN_ONCE to replace the commented BUG_ON size check") introduced a warning check to make sure that the size of the stat strings was always the expected value. This code accidentally inverted the check of the data pointer. Fix this so that we accurately count the size of the stats we copied in. This fixes an erroneous WARN kernel splat that occurs when requesting ethtool statistics. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Tested-by: Mauro S M Rodrigues <maurosr@linux.vnet.ibm.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent fa38e30 commit 07f3701

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2013,7 +2013,7 @@ static void i40e_get_stat_strings(struct net_device *netdev, u8 *data)
20132013
for (i = 0; i < I40E_MAX_USER_PRIORITY; i++)
20142014
i40e_add_stat_strings(&data, i40e_gstrings_pfc_stats, i);
20152015

2016-
WARN_ONCE(p - data != i40e_get_stats_count(netdev) * ETH_GSTRING_LEN,
2016+
WARN_ONCE(data - p != i40e_get_stats_count(netdev) * ETH_GSTRING_LEN,
20172017
"stat strings count mismatch!");
20182018
}
20192019

0 commit comments

Comments
 (0)