qlnic: fix a race in qlcnic_get_stats()
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 18 Aug 2010 00:42:48 +0000 (00:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Aug 2010 07:44:02 +0000 (00:44 -0700)
Dont clear netdev->stats, it might give transient wrong values to
concurrent stat readers.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic_main.c

index bf6d87adda4fff7a5aa1d1e20728383d08e621f1..213e3656d953be316732ec22e82dbaf8552b0555 100644 (file)
@@ -1983,8 +1983,6 @@ static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev)
        struct qlcnic_adapter *adapter = netdev_priv(netdev);
        struct net_device_stats *stats = &netdev->stats;
 
-       memset(stats, 0, sizeof(*stats));
-
        stats->rx_packets = adapter->stats.rx_pkts + adapter->stats.lro_pkts;
        stats->tx_packets = adapter->stats.xmitfinished;
        stats->rx_bytes = adapter->stats.rxbytes + adapter->stats.lrobytes;