ethtool: stats: Fix a copy-paste error
authorYueHaibing <yuehaibing@huawei.com>
Wed, 19 May 2021 02:10:38 +0000 (10:10 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 May 2021 18:57:33 +0000 (11:57 -0700)
data->ctrl_stats should be memset with correct size.

Fixes: bfad2b979ddc ("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>
net/ethtool/stats.c

index b7642dc..ec07f57 100644 (file)
@@ -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) &&