From: Eric Dumazet Date: Wed, 18 Aug 2010 00:42:48 +0000 (+0000) Subject: qlnic: fix a race in qlcnic_get_stats() X-Git-Tag: MMI-PSA29.97-13-9~22097^2~176 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1003201a73daed739747b9a6c2c39c57aad5878b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git qlnic: fix a race in qlcnic_get_stats() Dont clear netdev->stats, it might give transient wrong values to concurrent stat readers. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index bf6d87adda4f..213e3656d953 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -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;