net: sparx5: Fix get_stat64 crash in tcpdump
authorSteen Hegelund <steen.hegelund@microchip.com>
Thu, 3 Feb 2022 10:29:00 +0000 (11:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:56:25 +0000 (12:56 +0100)
commit7f486bed5ec09c7549879a9f817a723b732abf1c
tree1042f0dea2c130b5cd62543f7872553ab63ac5f1
parente4382d0a39f9a1e260d62fdc079ddae5293c037d
net: sparx5: Fix get_stat64 crash in tcpdump

[ Upstream commit ed14fc7a79ab43e9f2cb1fa9c1733fdc133bba30 ]

This problem was found with Sparx5 when the tcpdump tool requests the
do_get_stats64 (sparx5_get_stats64) statistic.

The portstats pointer was incorrectly incremented when fetching priority
based statistics.

Fixes: af4b11022e2d (net: sparx5: add ethtool configuration and statistics support)
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Link: https://lore.kernel.org/r/20220203102900.528987-1-steen.hegelund@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c