]> git.itanic.dy.fi Git - linux-stable/commit
i40e: fix condition of WARN_ONCE for stat strings
authorJacob Keller <jacob.e.keller@intel.com>
Mon, 20 Aug 2018 15:12:27 +0000 (08:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:25 +0000 (16:59 -0700)
commitff53d50516751b72412c98c53e968eb3e62e2f01
tree07f182280ece0b5aa315bd4aea38bab06e61a015
parentbe97150c4a540d6d98bee479de2d270a55efb400
i40e: fix condition of WARN_ONCE for stat strings

[ Upstream commit 07f3701387dcab3a4fb0166098fb2754a1b927e1 ]

Commit 9b10df596bd4 ("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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/i40e/i40e_ethtool.c