bnxt_en: Pass correct extended TX port statistics size to firmware.
authorMichael Chan <michael.chan@broadcom.com>
Fri, 26 Apr 2019 02:31:53 +0000 (22:31 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Apr 2019 21:00:19 +0000 (17:00 -0400)
commit6e8b2db88a22e3ecfa6053d999ace48012c7e38a
treeef41bd54eb9414a29d2fe81377077aba65b7c8d2
parentb03439be32a25d378a055e0447b2c1f1f68ddab3
bnxt_en: Pass correct extended TX port statistics size to firmware.

If driver determines that extended TX port statistics are not supported
or allocation of the data structure fails, make sure to pass 0 TX stats
size to firmware to disable it.  The firmware returned TX stats size should
also be set to 0 for consistency.  This will prevent
bnxt_get_ethtool_stats() from accessing the NULL TX stats pointer in
case there is mismatch between firmware and driver.

Fixes: cb4cbed87fff ("bnxt_en: Add additional extended port statistics.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c