]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: fix i40e_add_queue_stats data pointer update
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 31 Jul 2018 10:41:48 +0000 (03:41 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 7 Aug 2018 19:20:52 +0000 (12:20 -0700)
commit0432adf76fdb1c100ccb21848d828e7f2edb76cc
treea2d9959421ceffdfb02763b36c6ff72c11d50d4b
parentf634d2ca5b6e7218f2cd8b9397f4f1633a74bd30
i40e: fix i40e_add_queue_stats data pointer update

This function accidentally failed to update the data pointer, which
caused the reported stats to be incorrect. Additionally, statistics
which follow queue stats in the output would potentially read non-zeroed
garbage data from the ethtool buffer.

This occurred because the data double pointer was not dereferenced
before incrementing the size.

Additionally, make sure this issue is more visible by adding a WARN_ONCE
to the i40e_get_ethtool_stats function. This warning will trigger
whenever the data pointer is not at the expected address, similar to the
check that we make in the i40e_get_stat_strings() function.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c