Skip to content

Commit

Permalink
ethtool: stats: Fix a copy-paste error
Browse files Browse the repository at this point in the history
data->ctrl_stats should be memset with correct size.

Fixes: bfad2b9 ("ethtool: add interface to read standard MAC Ctrl stats")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YueHaibing authored and David S. Miller committed May 19, 2021
1 parent c9fd37a commit c71b996
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ethtool/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int stats_prepare_data(const struct ethnl_req_info *req_base,
*/
memset(&data->phy_stats, 0xff, sizeof(data->phy_stats));
memset(&data->mac_stats, 0xff, sizeof(data->mac_stats));
memset(&data->ctrl_stats, 0xff, sizeof(data->mac_stats));
memset(&data->ctrl_stats, 0xff, sizeof(data->ctrl_stats));
memset(&data->rmon_stats, 0xff, sizeof(data->rmon_stats));

if (test_bit(ETHTOOL_STATS_ETH_PHY, req_info->stat_mask) &&
Expand Down

0 comments on commit c71b996

Please sign in to comment.